Web hosting reviews - JavaScript Programmer’s Reference Metacharacter (Definition) A special symbolic

JavaScript Programmer’s Reference Metacharacter (Definition) A special symbolic way of describing some property of a character. Used in regular expressions. Refer to: RegExp pattern Method (Definition) A method is an action that can be performed on an object. Availability: ECMAScript edition 2 Functions are implemented in the script interpreter objects and are accessed as methods when they are themselves associated with an object. Methods are owned by objects. An instance of a class can own some private methods, which it does not share. It can also share methods it inherits from its prototype. Privately owned methods are sometimes called instance methods. Those functions that are associated with the Globalobject do not need an object prefix to be used. The Global object is always present and available and in the scope chain and prototype inheritance tree. Therefore the identifiers for those functions can be resolved easily, and in your script code they appear to be like functions in C language. When you declare functions in your script, as they are constructed they are associated with the Globalobject and are also available in the same way. Functions associated with the Math object require the Math object to be cited when they are called. Because they are visibly associated with the object and are called via the object, they are methods. You can specifically associate one of your own functions with an object other than the Global object. If you do that, then you can refer to the owner object with the variable named ‘this’. It is a special variable that is like the ’self’ variable in Smalltalk. Because a function is an object and associating it with your own object is by means of a reference to the function object, you can share function code between several objects. So, a method is simply a function that is written in a particular way that means it works well when associated with an object. As soon as you start to use the ‘this’ variable, then it’s likely your function is no longer useful as a stand-alone function and ought to really be called as a method from that point onwards. 1436

Leave a Reply