JS:Glossary
From MDC
- actual argument
- A value that is passed to a function during a function call. When an object is passed, it is passed as an object reference. See also formal argument.
- anonymous function
- A function without a function name.
- array
- A sequence of values. An array is an Array object. Sometimes, the term "array" is used to refer to an object that has array-like qualities, namely it has numerical property names and a
lengthproperty.
- argument
- An input to a function. Primitive arguments are passed "by value" - they are sent as copies to the function. Object arguments are passed "by reference" - an object reference to the object is sent to the function.
- boolean
- A primitive with two possible values: true and false. The Boolean object is a wrapper around a boolean primitive.
- call
- See function call.
- closure
- code
- The source code that is written by the programmer.
- constant
- constructor
- convert
- When used in the context of primitive to object or object to primitive conversions, a typecast.
- compile
- A synonym for parse, when JavaScript is to be interpreted by an engine.
- compile time
- The time from when the program is first loaded and until the program is parsed.
- datatype
- deep copy
- derive
- Document Object Model (DOM)
- An API for XML and HTML documents. The DOM is not part of JavaScript. JavaScript scripts within browsers have a binding to the DOM, whereby JavaScript can call DOM methods and otherwise interact with the DOM, and window is the global object.
- engine
- The JavaScript engine is an interpreter that parses and executes a JavaScript program.
- error
- An exception. Syntax error's are explictly specified as "syntax errors".
- exception
- execute
- To carry out a programming instruction. Happens during runtime.
- expression
- formal argument
- A placeholder within a function that is assigned an actual argument during a function call. A formal argument acts as a variable local to the function.
- function
- A body of code that can be called by other code or by itself, or a variable that refers to the function. When a function is called, arguments are passed to the function as input, and the function can optionally return an output. A function is also an object. See Functions.
- function call
- An execution of a function's code. A function is passed
- function declaration
- function expression
- function name
- An identifier that is declared as part of a function declaration or function expression. The scope this identifier is in depends on whether it is a declaration or expression.
- global object
- global scope
- global variable
- A variable in global scope. Such a variable is a property of the global object.
- identifier
- A sequence of characters in the code that identifies a variable, function, or property. Identifiers must start with a letter, "$", or "_", and can contain alphanumerical characters, "$", and "_". An identifier differs from a string in that a string is data, while an identifier is part of the code. In JavaScript, there is no way to convert identifiers to strings, but it is possible to parse strings into identifiers in certain cases.
- implement
- immutable
- Incapable of being changed.
- infinity
- A number value representing infinity. See Infinity.
- inner function
- A function within another function, which in turn is denoted as an outer function.
- instance
- An object created by a constructor is an instance of that constructor.
- instance property, instance method
- A property or method of all instances of a constructor, defined on that constructor's prototype. See also static property, static method.
- internal
- An object or data that cannot be directly accessed and operated on by the program, yet is necessary for the program's execution.
- interpret, interpreter
- See execute.
- list
- See array.
- local, local scope
- A variable or formal argument is local to a scope.
- local variable
- A variable that is in local scope.
- method
- A function that is a property of an object. Since functions themselves are objects, a method is actually an object reference to a function.
- mutable
- Capable of being changed.
- NaN
- A number value representing Not-a-Number. See NaN.
- null
- number
- A primitive with the value of a real number. Specifically, it has a double precision floating point value. The Number object is a wrapper around a number primitive.
- object
- In the context of a constructor, an instance of that constructor. Otherwise, an unordered collection of properties. To be more specific, an object is an associative array, where the keys are property names, and the values are property values. All objects are derived from Object, including arrays, and Object itself is also an object.
- object-oriented programming (OOP)
- A paradigm in which data is encapsulated within objects and the object itself is operated on, rather than its constituent parts. JavaScript is heavily object-oriented. It follows a prototype-based model.
- object reference
- A link to an object. Object references can be used as if they were the objects they link to. The concept of object references arises when assigning the same object to more than one property. Each assigned property does not hold a copy of the object. Instead, they hold object references that link to the same object. In practice, this means that if the object is modified, all properties referring to the object reflect the modification.
- operand
- operator
- outer function
- A function containing a function, which in turn is denoted as an inner function.
- parameter
- See argument.
- parent object
- The object a property is the property of.
- parse, parser
- To analyze and convert the program into an internal format which the JavaScript engine can work upon efficiently. In JavaScript, this is done during compile-time. and in certain cases where the parser is invoked, such as during a call to the eval method.
- pass
- Inputting to a function during a function call, e.g. an argument is passed to a function.
- primitive, primitive value
- A data that is not an object and does not have any methods. JavaScript has 5 primitive datatypes: string, number, boolean, null, undefined. With the exception of null and undefined, all primitives values have object equivalents which wrap around the primitive values, e.g. a String object wraps around a string primitive. All primitives are immutable.
- program
- The whole code to be interpreted and executed.
- property
- Part of an object. A property has a name and a value. The name is a string. The value can a primitive, method, or object reference. It is often stated that a property holds an object - this is shorthand for saying the property holds a reference to the object, as properties cannot directly hold the objects themselves. In the case of the property holding an object, there is a distinction between the property's value and the object due to the nature of object references - the property's value can be changed when it's set to another value, but this does not modify the previously referred object in any way.
- prototype
- recursion
- An act of a function calling itself.
- regular expression, regexp
- reference
- In the context of objects, an object reference. Otherwise, the JavaScript reference itself.
- run
- See execute.
- runtime
- Everything after compile-time.
- scope
- script
- A synonym for program, typically used when JavaScript is embedded within a document.
- statement
- static property, static method
- A property or method of a constructor, as opposed to an instance property or instance method.
- string
- A primitive with an immutable sequence of characters as its value. The String object is a wrapper around a string primitive.
- syntax
- syntax error
- type
- See datatype.
- type conversion, typecast
- undefined
- A primitive value automatically assigned to just-declared variables and formal arguments for which there are no actual arguments.
- value
- In the context of data or an object wrapper around that data, the primitive value that the object wrapper contains. In the context of a variable or property, something that can be either a primitive or an object reference.
- variable
- A placeholder where a value can be stored. In JavaScript, variables are actually properties. Variables are typically accessed through identifiers. See also global variable and local variable.
- wrapper, wrap
- An object that contains a primitive and whose sole purpose is to provide methods and properties to operate on that primitive. The wrapper's toString method returns the primitive.