• + 1 comment

    I did that way. Using only 3 lines of code is definitely a better approach, but I wanna share my code with you guys.

    for(i = 0; i < n; i++){
      var output = "";
      for(j = n; j > 0; j--){
    	if(i < j - 1){
    	output+=" ";
    	}else{
    	output+="#";
    	}
      }
      console.log(output);
    }