// Half or Left Triangle Pattern in JavaScript
let numberleft = 5;
let stringleft = '';
for(let i=1; i<=numberleft; i++){
for(let j=1; j<=i; j++){
stringleft += '*';
}
for(let k=1; k<= numberleft -i; k++){
stringleft += ' ';
}
stringleft += '
';
}
console.log(stringleft);