Content deleted Content added
No edit summary Tag: section blanking |
m Reverted edits by 182.71.17.18 to last version by Waterfalls12 (GLOO) |
||
Line 100:
; 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 ===
; run-time environment: JavaScript typically relies on a run-time environment (e.g. in a [[web browser]]) to provide objects and methods by which scripts can interact with "the outside world". In fact, it relies on the environment to provide the ability to include/import scripts (e.g. [[HTML]] <code><nowiki><script></nowiki></code> elements). (This is not a language feature per se, but it is common in most JavaScript implementations.)
; variadic functions<!--note: this is not a functional programming feature-->: An indefinite number of parameters can be passed to a function. The function can access them through [[formal parameter]]s and also through the local <code>arguments</code> object.
; array and object literals: Like many scripting languages, arrays and objects (associative arrays in other languages) can each be created with a succinct shortcut syntax. In fact, these [[Object literal|literals]] form the basis of the [[JSON]] data format.
; regular expressions: JavaScript also supports [[regular expression]]s in a manner similar to [[Perl]], which provide a concise and powerful syntax for text manipulation that is more sophisticated than the built-in string functions.
=== Vendor-specific extensions ===
|