In the Javascript, could I define a class, the class itself can also when a function call, similar to the index, such as:
function A()
{
}
var a=new A();
var v=a(); //Use ordinary/like Javascript function use
In the Javascript, could I define a class, the class itself can also when a function call, similar to the index, such as:
function A()
{
}
var a=new A();
var v=a(); //Use ordinary/like Javascript function use
This is a abuse of the constructor function syntax (it will work without the new)
function A(message)
{
return function(){alert("Make " + message);}
}
var a = new A("uncertain, divorce the wife say");
var v = a(); //Use ordinary/like Javascript function use
No,This instance "a" has no object "A" prototype
a instanceof A===false