After reading about the first class object i decided to make my new first-class object like a function but with another name. i searched and found many thing about functions in javascript.
conclusions from my research
1) that every function is an object and can also be treated like an object.
look here on code:
var myfunc3 = new Function(
"a", " return a + 1;");
from page this
as far as i know that any function defined before can be called by using new
constructor that is:
var person = function(name, age){
this.name=name;
this.age = age;
}
now i can call this by using new
that is:
var x = new person("tom", 34);
so from the above example i can say that a function defined earlier and then with new
can be called again!
What i don't know
1) how function uses its round brackets,
2) cannot understand the line Function( "a", " return a + 1;");
3) How can we implement function?
i know you will surely dislike this question but i want to do this because i want to understand every expact of JavaScript.
Thanks!