Back
Close

JavaScript promises, mastering the asynchronous

Magus
450.7K views

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

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');
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io