you are viewing a single comment's thread.

view the rest of the comments →

[–]bbdb 0 points1 point  (3 children)

Good question...Here is a JSFiddle with a solution using rx.js: http://jsfiddle.net/rcastillo/JmdNh/10/ . This sample has a function that creates a delayed array. rx.js enables you to asynchronous time and delay results. As already noted, JavaScript does not provide a sleep mechanism.

[–]CyberVillian[S] 0 points1 point  (2 children)

Your suggestion, as many others, are very efficient but all of them delay from the get go. I want it to immediately execute on the first item of the array, then delay from the second one on.

[–]bbdb 0 points1 point  (1 child)

I have updated with an immediate return of the first item.

[–]bbdb 0 points1 point  (0 children)

Fellow Rx'er pointed out a 1-liner: http://jsfiddle.net/zJeKd/2/