// because it's a dynamic language dict.FirstName = "Chris"; for(var key in dict) { var value = dict[key];
Since JavaScript is a functional language, functions are objects too. As a result,
Functions can also be used as either Key and/or Value on your dictionary var dict = {};
var f = function() { // do something };
// setup Function as Value
dict['method'] = f;
// setup Function as Key
dict[f] = 'some value';
// execute Function from Value
dict['method']();
var method = dict.method;
method();
// get value for Key
var val = dict[f]; The main difference between the two operators is how they compare values. The == operator compares the values of two variables after performing type conversion if necessary. On the other hand, the === operator compares the values of two variables without performing type conversion.
How to check if a person is workig in Circle Office
Discover Functional JavaScript - An Overview of Functional and Object Oriented Programming in JavaScript (Functional Programming With JavaScript and React Book 1)