Williammer
6/4/2014 - 9:49 AM

javaScript.ReferenceTypesExamples.js - The most obvious features of the three reference types.

javaScript.ReferenceTypesExamples.js - The most obvious features of the three reference types.

//Reference Types Examples

var ref_fn = function () {
    return true;
}
, ref_obj = {
    name: 'obj'
}
, ref_arr = ['arr', 2, {
    "p": 3
}]


var aa = ref_fn;
ref_fn.prp = 'xxref_fn';
alert('ref_fn: ' + aa.prp);

var aa = ref_obj;
ref_obj.prp = 'xxref_obj';
alert('ref_obj: ' + aa.prp);

var aa = ref_arr;
ref_arr.prp = 'xxref_arr';
alert('ref_arr: ' + aa.prp);