Declared functions are added to the script source text to provide additional functions that are only needed while that script is being executed.
Declaring a function in a script requires a function declaration, which includes the name of the function, its arguments and a block of source script code to be executed when the function is called.
Through the Prototype Inheritance mechanism, this script code will be called in preference to any identically named function higher up the inheritance chain. This provides a way to override methods in parent object classes, which mimics (but is not identical to) the sub-class/super-class relationships in class-based languages.
See also: | Function object, function( ... ) ... |
Prev | Home | Next |
Declaration | Up | decodeURI() |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |