Skip to content

Files

Latest commit

edea154 · Jun 11, 2018

History

History

Section 5 - Async Foundations

What is an Asynchronous event?

Stackoverflow Answer

Callback Functions

Callback Slides

Example Files

Array forEach

forEach Slides

Example Files

Array findIndex

findIndex Slides

Example files

Exercise: Implement own findIndex function

My solution:

    
        function ownFindIndex(arr,fn){
            for(let i=0;i

The Stack and the Heap

Slides

Example

What the heck is an event loop? - by Philip Roberts

setTimeout and setInterval

Slides

countDown Exercise: - The goal is to Implement a function called countDown that accepts a time in seconds. The function will print the time remain to the console every second. Instead of printing 0, the function should print "Ring Ring Ring!!!".

My solution:

    
        function countDown(time){
            let timerId = setInterval(function(){
                console.log("Time remaining:",time);
                time--;
                if(time === 0){
                    console.log("Ring Ring Ring!!!");
                    clearInterval(timerId);
                }
            },1000);
        }
    

The Event Loop and the Queue

Slides

Promise basics

Slides

Promise Chaining

Slides