Copyright By Free for non-commercial use. Editable provided that the copyright claim is included.
Notational Conventions For Heading Slides: Background Hue: Red, Yellow, Green, Cyan, Blue, Magenta as in Iris Saturation decreases Brightness increases Color offset to Background Font size decreases Position Shifted right Sideline slides are grey
Notational Conventions Unordered List Bullets Ordered by color and the bigness of colored area Font size decreases
Built in objects
Category Native Objects Built In String, Number, Array, Image, Date, Math User-Defined Objects. Host Objects window
global is read only and cannot be referenced. window is a member of global. window refers to global.
NaN Infinity undefined
isNaN isFinite
parseInt parseFloat
URI decodeURI decodeURIComponent encodeURI encodeUTIComponent escape unescape
encodeURI('a//: 中文 ') "a//:%20%E4%B8%AD%E6%96%87" encodeURIComponent('a//: 中文 ') "a%2F%2F%3A%20%E4%B8%AD%E6%96%87"
Escape is used for strings encodeURI(‘a 中文 ') “a%20%E4%B8%AD% E6%96%87" escape("ab._ 中文 c") "ab._%20%u4E2D%u6 587c"
constructors Boolean Number String Object Function Array
constructors Date RegExp
error Error EvalError RangeError ReferenceError SyntaxError TypeError URIError
Math JSON
eval
Object can be used as a [function] Thus a constructor.
Object alert(Object instanceof Object);//true alert(Object instanceof Function);//true alert(typeof Object); //function Object function (){[navti ve code]} Object.pr ototype Inherit{1}.prototype “Creat e”.constructor inherit Object Function.prototype.constructor
Object.prototype
Object.prototype.toString ( ) [object class]
Function’s Constructor Function function (){[navti ve code]} Object.pr ototype Inherit{1}.prototype “Create”.constructor inherit Function Function.prototype.a=1; alert(Function.a);
(A function)’s Constructor function f() { } alert(f.constructor); alert(f.constructror.constructor); alert(Function.constructor); alert(f.constructor.constructor.c onstructor); alert(f.constructor.constructor.c onstructor.constructor); Function funct ion1 function (){[navti ve code]} Object.pr ototype Inherit{1}.prototype Create.constructor inherit
Function the [[Class]] Function is a sub[[Class]] of “Object”[[Class]]
Function.prototype
Function prototype object is itself a Function object (its [[Class]] is "Function") that, when invoked, accepts any arguments and returns undefined.
Unless specified otherwise, the [[Class]] internal property of a built-in object is "Function" if that built-in object has a [[Call]] internal property, or "Object" if that built-in object does not have a [[Call]] internal property.
Function Instances
function function a() { } a=function(){} function (){} new Function() Function(…)
String var a = String("a"); var b = new String("b"); alert(typeof a);//string alert(a);//a; alert(typeof b);//object alert(b);//b
Date Date() returns a string new Date() returns an object inspect( Date() ); inspect( new Date() );
Math [[Class]] Math
Array [[Class]]:Array
Date.prototype.toString This function returns a String value. The contents of the String are implementation-dependent, but are intended to represent the Date in the current time zone in a convenient, human-readable form.
JSON contains two functions, parse and stringify, [[Class]] JSON Extensible [[Construct]] false [[Call]] false
Thank You!