What is the difference between these two methods?
function ObjectB() {
this.methodA = new function() {
alert('a');
};
this.methodB = function() {
alert('b');
};
}
What I am trying to ask, is what effect does the new have in a JS method?
I've done a fiddle where I wanted to explore the behaviour of the methods, and I have also added this code :
var v = Object.create(ObjectB);
v.methodC = function() {
alert('c');
}
v.methodB();
v.methodA();
v.methodC();
But my fiddle doesnt seem to work.
Fiddle is here : http://jsfiddle.net/N8SNG/
Thanks :)