An open API service indexing awesome lists of open source software.

https://github.com/swanie21/module-3-prework

Learn about Lodash, express.js, JS promises, and JS scope/chains/closures over intermission break
https://github.com/swanie21/module-3-prework

chains closure express lodash promises scope

Last synced: 8 months ago
JSON representation

Learn about Lodash, express.js, JS promises, and JS scope/chains/closures over intermission break

Awesome Lists containing this project

README

          

# Module 3 Prework

## Lodash

Lodash is a JavaScript utility library that enhances performance and functionality with arrays, objects, and strings. An underscore prepends the method like this: `_.filter.`

## Express.js

Express.js is a minimal and flexible Node.js web application framework. It simplifies development and reduces repetitive code.

## JavaScript Promises

Promise object is used for asynchronous successes and failures. A promise can have the state of being fulfilled, rejected or pending. A promise takes in one argument, a callback with the two parameters of resolve and reject, and performs something within the callback that invokes the parameters.

## Scope

Scope is the context of your code dependent upon whether a variable is declared inside or outside a function. Scope can either be global or local.

Lexical Scope is when a function is within another function and the inner function has access to the scope of the outer function. (aka: Static Scope)

## Scope Chains

Scope chains establish the scope for a given function by determining nested scopes and what scope is associated with what function. The scope chain starts at the innermost scope and works its way outwards.

## Closures

Closures are created when a function is within another function and the inner function has access to the outer function's variables and parameters. A closure has three scope chains: access to its own scope, access to the outer function's variables, and access to the global variables.