Last Updated: February 25, 2016
· brandturner

Relearning Javascript the Right Way

Week 2

function setName(obj) { = “Nicholas”;
    obj = new Object(); = “Greg”;

var person = new Object();
alert(; //”Nicholas”

In Javascript, all functions arguments are passed by value. Since a new object was instantiated within the function, the person object is no longer linked to obj.

null is an object type. Uninstantiated values are undefined. If you want to see what type of object it is, use this formula:

result = variable instanceof constructor
alert(person instanceof Object