clmlbx
Technomancer
guys I want to print this in Javascript
*______*
**____**
***__***
********
Below is the code for it.. to simplify above sequence has total 8 characters in any line.. ( 8 - stars) = underscores in any line
*______*
**____**
***__***
********
Below is the code for it.. to simplify above sequence has total 8 characters in any line.. ( 8 - stars) = underscores in any line
Code:
var row = "";
var co;
for(i=1;i<=4;i++){
for(j=1;j<=i;j++){
row += "*";
co++;
}
for(k =(8-(co+co));k>0;k--){
row += "_";
}
for(l=1;l<=i;l++){
row += "*";
}
console.log(row);
}