This content is an early DRAFT that is not implemented in the Outlearn platform.
// Challenge :: Code execution order ::
{
Consider the code sample below:
var fs = require('fs') // require is a special function provided by node
var myNumber = undefined // we don't know what the number is yet since it is stored in a file
function addOne() {
fs.readFile('number.txt', function doneReading(err, fileContents) {
myNumber = parseInt(fileContents)
myNumber++
})
}
addOne()
console.log(myNumber)
When the code gets executed, which line will be executed first?
( ) myNumber++
( ) console.log(myNumber)
( ) One or both of them will not be executed
}