the reference to the object that is passed. var obj1 = {a : 1}; var obj2 = {b : 2}; function foo(p) { p = obj2; // Ignores actual parameter p.b = arguments[1]; } foo(obj1, 3); // Does not affect obj1 at all. 3 is additional parameter console.log(obj1.a + " " + obj2.b); // writes 1 3 Functions can be declared inside other functions, and access the outer function's local variables. Furthermore, they implement full closures by remembering the outer function's local variables even after the outer function has exited. let t = "Top"; let bar, baz; function foo() { let f = "foo var"; bar = function() { console.log(f) }; baz = function(x) { f = x; }; } foo(); baz("baz arg"); bar(); // "baz arg" (not "foo var") even though foo() has exited. console.log(t); // Top Async/await Objects For convenience, types are normally subdivided into primitives and objects. Objects are entities that have an identity (they are only equal to themselves) and that map property names to values ("slots" in prototype-based programming terminology). Objects may be thought of as associative arrays or hashes, and are often implemented using these data structures. However, objects have additional features, such as a prototype chain, which ordinary associative arrays do not have. JavaScript has several kinds of built-in objects, namely Array, Boolean, Date, Function, Math, Number, Object, RegExp and String. Other objects are "host objects", defined not by the language, but by the runtime environment. For example, in a browser, typical host objects belong to the DOM (window, form, links, etc.). Creating objects Objects can be created using a constructor or an object literal. The constructor can use either a built-in Object function or a custom function. It is a convention that constructor functions are given a name that starts with a capital letter: // Constructor var anObject = new Object(); // Object literal var objectA = {}; var objectA2 = {}; // A != A2, {}s create new objects as copies. var objectB = {index1: 'value 1', index2: 'value 2'}; // Custom constructor (see below) Object literals and array literals allow one to easily create flexible data structures: var myStructure = { name: { first: "Mel", last: "Smith" }, age: 33, hobbies: ["chess", "jogging"] }; This is the basis for JSON, which is a simple notation that uses JavaScript-like syntax for data exchange. Methods A method is simply a function that