Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to make stairs in javascript

penWidth(20);
for (var count = 0; count < 6; count++) {
  moveForward(50);
  turnRight(90);
  moveForward(50);
  turnLeft(90);
}
Comment

js stairs algorithm

function staircase(n) {
    let filledArray = new Array(n).fill(' ');
    while (filledArray.indexOf(' ') !== -1) {
        filledArray.shift();
        filledArray.push('#');
        console.log(filledArray.join(""));
        n--;
    }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to loop and add number in fuction for javascript 
Javascript :: committing only part of a file git 
Javascript :: character limit regex 
Javascript :: js check if element hidden 
Javascript :: random number in range js 
Javascript :: delete all node modules 
Javascript :: JS DOM how to add a class name to any HTML element 
Javascript :: javascript submit a form with id 
Javascript :: npm install run audit fix 
Javascript :: formik clear field 
Javascript :: js image on canvas 
Javascript :: javascript iterate over chars in string 
Javascript :: for loop infinite javascript 
Javascript :: moment month start date and end date 
Javascript :: js get svg width 
Javascript :: Ts get first string char 
Javascript :: how to print line break in javascript 
Javascript :: make select option selected javascript 
Javascript :: shadow in react native 
Javascript :: install react app 
Javascript :: new nextjs project 
Javascript :: javascript dynamicly include another js file 
Javascript :: how to generate random rgb color number in javascript 
Javascript :: Append element to a different parent 
Javascript :: react native run on device command line 
Javascript :: sum of n numbers in javascript 
Javascript :: shadown reAct native 
Javascript :: javascript get a random array from 1 to n 
Javascript :: express body-parser is depreciated 
Javascript :: store data in array jquery 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =