Read: Class 03 - 401-advanced-javascript-dania/amman-javascript-401d1 GitHub Wiki
Hoisting
In Javascript, variable and function declarations get “hoisted” to top of your code before it runs.
The Call Stack
In Javascript, every synchronous function that is called is pushed onto a stack in V8. The function on top of the stack is always the function that is currently executing. When the function that is running returns it is “popped” off a stack.
The Callback Queue
When an asynchronous function called “foo” is invoked, it is pushed onto the V8 call stack. Then “foo” makes a call to a browser/Node.js API and passes on a callback. Then the “foo” function returns and is popped off of the call stack, and V8 keeps on executing synchronous code
4)The Event Loop
The event loop is in charge of dequeueing callbacks from the V8 callback queue and pushing them on to the call stack. It has one rule for doing this. It will only push a callback on to the call stack if it is empty.
5)Defining an Error First Callback
a callback is simply a function that is passed as an argument to another function
6)Javascript Promise Pattern (promises)
Promises are one way to manage Asynchronous actions. Like a callback, a promise allows you to execute some code and “move on”, allowing for that code to take as long as it needs to run.
7)File System I/O
The Node.js fs module gives Node.js programmer’s the ability to perform file system operations. The fs module has the ability to Create, Read, Update, and Delete files using many different methods. Most methods on the fs module have synchronous and asynchronous implementations.
8)Buffer
Buffers are Node.js built-in constructors for working with binary data, also called raw data. Buffer is a global constructor in NodeJs. When reading from the filesystem, network, or elsewhere data is usually presented to the developer in the form of a buffer. Buffers are an array of bytes, with many useful methods for reading and writing data. The data in buffers can be decoded as integers, floating point numbers, and strings.
9)Mock Testing
When testing outside functionality (such as a server, database, or a filesystem), it’s customary to “mock” that functionality rather than use the real thing.