JavaScript promises, mastering the asynchronous

Magus
471.9K views

Open Source Your Knowledge, Become a Contributor

Technology knowledge has to be shared and made accessible for free. Join the movement.

Create Content

It's time to test if you are really listening. 😉

What are 2 native functions to run code asynchronously in JavaScript ?
let fs = require('fs');

console.log('1');

fs.readFile('test.txt', 'utf8', function(error, data) {
    if (error) {
         throw error;
    }

    console.log('2');
});

console.log('3');
What is the output of the code above?
What is the function to stop an interval timer?
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content