| constructor: function( | path, | | baseObj | ) |
|
Class constructor
Arguments
| path | String[], a string array of path parts to this object, relative to baseObj |
| baseObj | object, the parent object that this path refers to. If not specified “window” is assumed (that is, the global variable scope) |
Example
var cat = { breed: "Rag Doll", name: "Maximus" };
var catNameRef = new Jel.ObjectPath(["cat", "name"]);
var catName = cat.name;
cat.name = "Max";
alert(catName); // "Maximus" (original value, since assignment is by value)
console.log(catNameRef.get()); // "Max" (updated value, since assignment is by reference)