Thursday, 27 April 2017

How to print a pyramid from an array using settimeout in JavaScript

I have an array like this

[1,2,3,4,5]

I have to print pyramid in the console by iterating the given array like this

1
1,2
1,2,3
1,2,3,4
1,2,3,4,5

But each element in the pyramid ( say 1 in first row) should be printed with given time interval using settimeout() function



via NIKHIL C M

No comments:

Post a Comment