Content deleted Content added
Revert of good faith edit(s) by 123.176.41.13 using STiki |
|||
Line 120:
; prototypes: JavaScript uses [[prototype-based programming|prototypes]] instead of [[Class (computer science)|classes]] for [[Inheritance (computer science)|inheritance]]. It is possible to simulate many class-based features with prototypes in JavaScript.
; functions as object constructors: Functions double as object constructors along with their typical role. Prefixing a function call with <code>new</code> creates a new object and calls that function with its local <code>this</code> keyword bound to that object for that invocation. The constructor's <code>prototype</code> property determines the object used for the new object's internal prototype.<!-- this topic is a bit more complex than presented here --> JavaScript's built-in constructors, such as <code>Array</code>, also have prototypes that can be modified.
; functions as methods<!--not sure where to classify this under-->: Unlike many object-oriented languages, there is no distinction between a function definition and a [[method (computer science)|method]] definition. Rather, the distinction occurs during function calling; a function can be called as a method. When a function is called as a method of an object, the function's local <code>this</code> keyword is bound to that object for that invocation.
===Miscellaneous===
|