Skip to content

Instantly share code, notes, and snippets.

View rajpootmohan's full-sized avatar
🎯
Focusing

Mohan rajpootmohan

🎯
Focusing
View GitHub Profile
@rajpootmohan
rajpootmohan / gist:2e52ada2dfef8b25f67d9acfa63cfa8e
Created September 8, 2017 09:23
Node module export and require
1. FIRST-CLASS FUNCTIONS: Everything you can do with other types you can do with function. Like put them in array, set variables equal to them, etc.
2. AN EXPRESSION: A block of code that results in a value.
5. PRIMITIVE: A type of data that represents a single value. Means no object.
6. PASS BY VALUE VS PASS BY REFERENCE: primitive values work as pass by value but objects work as pass by reference.
7. IMMEDIATLY INVOKED FUNCTION EXPRESSIONS (IIFE): function which is immediatly invoked without affecting any other scope of variables and methods. Syntax is :
var firstName = "Random";
(function(lastName){
var firstName = "Mohan";
console.log(firstName);
console.log(lastName);