Here is the code to display pyramid but its not exactly producing required output.
If you want to print out a right angle triangle using symbols or single digits. You can use the following code.
let pyramid = ''; for(pyramid.length=0; pyramid.length<=7 ; pyramid+='#'){ console.log(pyramid); }