Please enable JavaScript.
Coggle requires JavaScript to display documents.
Java Script - Coggle Diagram
Java Script
-
-
callback
A JavaScript callback is a function which is to be executed after another function has finished execution. A more formal definition would be - Any function that is passed as an argument to another function so that it can be executed in that other function is called as a callback function.
Callbacks are a great way to handle something after something else has been completed. By something here we mean a function execution. If we want to execute a function right after the return of some other function, then callbacks can be used. JavaScript functions have the type of Objects
Promise
Promises are JavaScript objects that represent an eventual completion or failure of an asynchronous operation
The Promise object supports two properties: state and result
A key difference between the two is when using the callback approach, we’d normally just pass a callback into a function that would then get called upon completion in order to get the result of something. In promises, however, you attach callbacks on the returned promise object.
async wait
-
The keyword 'async' before a function makes the function return a promise, always. And the keyword await is used inside async functions, which makes the program wait until the Promise resolves
DataType
Strings, numbers and Booleans
-
-
-
-
-
-
Interpretive language, take example of mechanic or cook Vs Compiler
Interpreted instruction by instruction(Quick to start but overall slow to execute, but can be altered by easily) vs piled once and run as compiled(All instructions piled and checked at once, slow to start by quick to run and execute)