Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exercise 38 pre correction #149

Open
stegrams opened this issue Jul 12, 2016 · 0 comments
Open

Exercise 38 pre correction #149

stegrams opened this issue Jul 12, 2016 · 0 comments

Comments

@stegrams
Copy link

stegrams commented Jul 12, 2016

pre tag in exercise 38 should contain

seq([1,2,3,,,,,,,4,5,6,,,]).throttle(1000 /* ms */) === seq([,,3,,,,,,,6,,,]); 
// instead of seq([,,,,,,,3,,,,,,,,,,6,,,]);

The seq test i used was

function testSeq(sq){
    var now1 = Date.now();

    function log(i){ 
        var now2 = Date.now();
        var intervalInSec = Math.round((now2 - now1) / 100) / 10; 
        if(intervalInSec >= 0.5){
            console.log(intervalInSec +'s'); 
        }
        now1 = now2;
        console.log(i)
    }

    sq.forEach(log);
}

In both cases testSeq(seq([1,2,3,,,,,,,4,5,6,,,]).throttle(1000)) and testSeq(seq([,,3,,,,,,,6,,,])) I had the same results

_CREATED: 16:13 - UPDATED: 17:50 and 18:25_

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant