Skip to content

Mhayk Whandson

Keep your mind open to learn more and more to evolve ..

Recent Posts

  • Nullish Coalescing in JavaScript
  • Optional Chaining in JavaScript
  • Tree Data Structure
  • JS – Async question 1 ..
  • Meetup ! Awesome!

Recent Comments

    Archives

    • October 2021
    • February 2020
    • January 2019
    • April 2017
    • November 2016
    • May 2016
    • April 2016
    • March 2016
    • February 2016
    • September 2015

    Categories

    • Algoritmos
    • Artigos sobre o cérebro
    • Economia
    • JavaScript
    • Kumon
    • Linux
    • London
    • Programação
    • Sem categoria
    • URI

    Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org

    Month: January 2019

    JS – Async question 1 ..

    Make it run without errors but you cannot change the location of the `let` statement, that has to stay at the end.

    This was a trick question.

    Callbacks are not async by default, this was a sync call so the message var was not defined by the time the callback was called.To make this work we need to wrap our call to `cb` in either a `setImmediate` or a `process.nextTick`.


    Posted on 02/01/201902/01/2019Categories JavaScriptLeave a comment on JS – Async question 1 ..
    Proudly powered by WordPress