I am new to JavaScript. I want to print this star pattern using console.log() in JavaScript
*
* *
* * *
* * * *
* * * * *
I tried this code
for(var i=1; i <= 5; i++)
{
for(var j=1; j<=i; j++)
{
console.log('*');
}
}
Each * is getting printed on a separate line.
Kindly help. Thanks :)