The Journey of #100DaysOfCode (@Tala_Hareb)

Day 1:

Today I learned about “Promises” in JS.

Definitions :

  • Promises : A way to handle asynchronous operations. ( put simply: They represent a value that might be available now, in the future, or never. ) => formally noted as pending, fulfilled, or rejected.
  • Asynchronous operations : Allow a task to start, continue doing other things, and then finish later. They don’t block or stop the program from running other code in the meantime.

Initializing a Promise :

  • using const : const = constant. Use const when you know you won’t change the promise.
  • using let : let = let this variable change if needed. Use let when you think you might need to change the promise to something else.

3 Likes