EXERCISE · AlgoCasts

Steps

Write a function that accepts a positive number N. The function should console log a step shape with N levels using the # character.

4 testsAlgoCastsGPL-3.01 alternateexercise 09 of 26

Directions

Directions

Write a function that accepts a positive number N. The function should console log a step shape with N levels using the # character. Make sure the step has spaces on the right hand side!

Examples#

JS
steps(2)    '# '    '##'steps(3)    '#  '    '## '    '###'steps(4)    '#   '    '##  '    '### '    '####'

Try it first#

Copy the stub, make the 4 tests pass on your machine, then open the solution. The reveal is remembered per page in this browser.

JSexercises/steps/index.js
function steps(n) {} module.exports = steps;

See also