If you want something you've never had, you must be willing to do something you've never done!

Powered by Blogger.

JavaScript Objects (Functions Again) 0

Cerita Semalam Aaz | 9:05 AM | ,


A function is a first-class
JavaScript Object


Functions are a bit like Java methods
>       They have arguments and return values

A function is a first-class object in JavaScript (unlike in Java)
>      Can be considered as a descendant of Object

>      Can do everything a regular JavaScript object can do such as storing properties by name
>       Function objects can have other function objects as methods





A function can take Variable arguments

You can call myfunction() or myfunction(20)



function myfunction(value){
if (value)this.area=value;
}
return this.area;
}



0 Responses So Far:

Related Post

 
Back To Top