JSFiddle - React, Tailwind, and code Playground

by Alexey

JavaScript

function steps(step) {
console.log(step)
  let x = step;
  let c = ''
  while (x > 0) {
    c += 'x';
    let diff = step - c.length;
    let v = diff;
    console.log(diff);
    while (v > 0) {
    c+= ''
    v--;
    }
    x--;
  }

}


steps(3)