Skip to main content
0:00est. 2 min

Chapter 32- Framework Aside (Faking Namespaces)

Notes

#BIGWORD Namespace : A container for variables and functions,Typically to keep variables and functions with the same name separate.
var greet = "hello";
var greet = "hola";
console.log(greet);

//create an object, that would work as a container for our methods and properties
var english = {};
var spanish = {};
//now following greet will not collide with each other
english.greet = "hello";
spanish.greet = "hola";
console.log(english);