learnrx icon indicating copy to clipboard operation
learnrx copied to clipboard

Exercise 38 pre correction

Open stegrams opened this issue 9 years ago • 0 comments

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_

stegrams avatar Jul 12 '16 13:07 stegrams