私はstackoverflowを通じてこれにつまずきました.
私は大学で C++ を勉強しましたが、ポインタはちょっと覚えています
http://www.permadi.com/tutorial/jsFunc/index2.html
私の問題はコードで始まり、特定のことが機能していません
function theAdd(a, b){
return a*b;
}
//creating a copy of the function
var add3 = new theAdd();
add3.name = 'nameProperty';
//alert( add3(1,2)) //why doesn't this work?
alert(theAdd(5,5) + " " + theAdd.name);
function Ball() {
return 'balltext';
}
var ball0=new Ball(); // ball0 now points to a new object
alert( Ball() ); // this works
alert( ball0() ); // why doesn't this work? shouldn't it return balltext?