I have been trying out some js code in jsfiddle and it seems I cant get all these combinations of codes below to work..
//combination #1
function get_set() {
this.get = function () {
document.write("get");
};
this.set = function () {
document.write("set");
};
};
var x = get_set; // storing function reference in x
x.get(); //invoking doesnt work.
//combination#2
var get_set = function() {
this.get = function () {
document.write("get");
};
this.set = function () {
document.write("set");
};
};
get_set.get(); //doesnt work as well..
Is there something that I miss? Thanks in advance for constructive suggestion/pointing out any errors. Would appreciate any help.