copyright by [email protected]@nilnul.com free for non-commercial use. editable...

41
Copyright By [email protected] Free for non-commercial use. Editable provided that the copyright claim is included.

Upload: jasmine-rose

Post on 31-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

Copyright

By [email protected]

Free for non-commercial use.Editable provided that the copyright claim is

included.

Page 2: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

Notational ConventionsFor Heading Slides:

Background Hue: Red, Yellow, Green, Cyan, Blue, Magenta

as in Iris Saturation decreases Brightness increases

Color offset to BackgroundFont size

decreasesPosition

Shifted rightSideline slides are grey

Page 3: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

Notational Conventions

Unordered List BulletsOrdered by color and the bigness of colored areaFont size decreases

Page 4: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

Built in objects

Page 5: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

CategoryNative Objects

Built In String, Number, Array, Image, Date, Math

User-Defined Objects.

Host Objectswindow

Page 6: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included
Page 7: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

global is read only and cannot be referenced.window is a member of global.window refers to global.

Page 8: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included
Page 9: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

NaNInfinityundefined

Page 10: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

isNaNisFinite

Page 11: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

parseIntparseFloat

Page 12: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

URI decodeURIdecodeURIComponentencodeURIencodeUTIComponent

escapeunescape

Page 13: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

encodeURI('a//: 中文 ') "a//:%20%E4%B8%AD%E6%96%87"

encodeURIComponent('a//: 中文 ') "a%2F%2F%3A%20%E4%B8%AD

%E6%96%87"

Page 14: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

Escape is used for strings

encodeURI(‘a 中文 ') “a%20%E4%B8%AD

%E6%96%87"

escape("ab._ 中 文c")

"ab._%20%u4E2D%u6587c"

Page 15: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

constructorsBooleanNumberStringObjectFunctionArray

Page 16: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

constructorsDateRegExp

Page 17: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

errorErrorEvalErrorRangeErrorReferenceErrorSyntaxErrorTypeErrorURIError

Page 18: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

MathJSON

Page 19: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

eval

Page 20: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included
Page 21: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

Object can be used as a [function]Thus a constructor.

Page 22: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

Objectalert(Object

instanceof Object);//true

alert(Object instanceof Function); //true

alert(typeof Object);//function

Object

function()

{[navtive

code]}

Object.prototype

Inherit{1}

.prototype

“Create”

.constructor

inherit

Object

Function

.prototype

.constructor

Page 23: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

Object.prototype

Page 24: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

Object.prototype.toString ( ) [object class]

Page 25: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included
Page 26: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

Function’s Constructor

Function

function()

{[navtive

code]}

Object.prototype

Inherit{1}

.prototype

“Create”

.constructor

inherit

Function

Function.prototype.a=1;alert(Function.a);

Page 27: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

(A function)’s Constructorfunction f() { }alert(f.constructor);alert(f.constructror.construc

tor);alert(Function.constructor);alert(f.constructor.construct

or.constructor);alert(f.constructor.construct

or.constructor.constructor);

Function

function

1

function()

{[navtive

code]}

Object.prototype

Inherit{1}

.prototype

Create

.constructor

inherit

Page 28: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

Function the [[Class]]Function is a sub[[Class]] of “Object”[[Class]]

Page 29: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

Function.prototype

Page 30: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

Function prototype object is itself a Function object (its [[Class]] is "Function") that, when invoked, accepts any arguments and returns undefined.

Page 31: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

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.

Page 32: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

Function Instances

Page 33: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

functionfunction a() { }

a=function(){}function (){}new Function()

Function(…)

Page 34: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included
Page 35: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

String

var a = String("a");var b = new String("b");

alert(typeof a);//stringalert(a);//a;alert(typeof b);//objectalert(b);//b

Page 36: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

DateDate() returns a stringnew Date() returns an object

inspect(Date()

);inspect(

new Date());

Page 37: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

Math[[Class]] Math

Page 38: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

Array[[Class]]:Array

Page 39: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

Date.prototype.toStringThis 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.

Page 40: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

JSONcontains two functions, parse and stringify,[[Class]] JSONExtensible[[Construct]] false[[Call]] false

Page 41: Copyright By wangyoutian@nilnul.comwangyoutian@nilnul.com Free for non-commercial use. Editable provided that the copyright claim is included

Thank You!