I wrote this method that draw a Triangle. For example if you call drawTriangle(5) you get the following output:
this is my code :-
function drawTriangle(t){
for (let i=1; i <= t; i++)
{
for (let j=1; j<=i; j++)
{
console.log(j+" ");
}
console.log("\n");
}
}
let t = 5 ;
drawTriangle(t);
I can not make them in a line I don't Know where is the problem .