forked from Hacker233/JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
364 changed files
with
222 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+20.9 MB
JavaScript电子书/[JavaScript权威指南(第6版)]/JavaScript权威指南_第6版_zh-CN.淘宝前端团队%5D. David Flanagan.pdf
Binary file not shown.
Binary file added
BIN
+3.72 MB
...威指南(第6版)]/[JavaScript权威指南(第6版)].(JavaScript:The.Definitive.Guide).David.Flanagan.文字版.epub
Binary file not shown.
Binary file added
BIN
+13.5 MB
...权威指南(第6版)]/[JavaScript权威指南(第6版)].(JavaScript:The.Definitive.Guide).David.Flanagan.文字版.pdf
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+20.9 MB
JavaScript电子书/[JavaScript权威指南(第6版)]/[JavaScript权威指南(第六版)].(美)David.Flanagan.中文扫描版.pdf
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,216 @@ | ||
js | ||
|
||
һ���ʷ��ṹ | ||
1�����ִ�Сд | ||
2��ע�� // ���� /* ����ע�� */ | ||
3��������(ֱ���� literal) | ||
12 //���� | ||
5.8 // �� | ||
"hello" | ||
'hello' | ||
true | ||
/js/gi //���� | ||
null //�� | ||
{x:1,y:2} | ||
[1,2,3,4] | ||
4����ʾ��(����)�ͱ����� | ||
5���ֺſ���ʡ�Ե��ǿ��ܻ�������⣬js���Զ���; | ||
var y = x+f | ||
(a+b).toString() | ||
�ȼ��� | ||
var y = x+f(a+b).toString(); | ||
�������͡�ֵ�ͱ��� | ||
1��ԭʼ���� ���֡��ַ����Ͳ��� null�� undefinedδ���� | ||
2���������� | ||
3���� Array Function Date RegExp Error | ||
4��js������ ������������� | ||
5������js��ֵ������תΪ����ֵ | ||
undefined | ||
null | ||
0 | ||
-0 | ||
NaN | ||
"" ����ת��Ϊfalse | ||
6����װ���� | ||
var s= "hello"; //ԭʼ���� ��û�з����� | ||
s.len = 4; //������ԭʼ���͵����Ի���ʱ��ԭʼ������û�����Ժͷ����ģ� | ||
//ֻҪ�������ַ��������Ի����ͻ����new String(s)��ԭʼ���ͣ���װ�ɶ��� | ||
//�Ժ����s.len �ǵ���String��������Ժͷ�����һ�����ý������´�������ʱ��������� | ||
var n = s.len; //��ʱΪundefined | ||
alert(n); | ||
|
||
//�����ַ��� ���� ���ֵ����Ի�ʱ����������ʱ�����ǰ�װ���� | ||
��ʾ�����װ���� var S = new String("hello") | ||
var s = "hello"; �Dz�ͬ�� | ||
7��==��=== | ||
8������ת�� | ||
var n = 17; | ||
alert(n.toString(2)); //������ 10001 | ||
alert(n.toString(8)); // 021 | ||
alert(n.toString(16)); // 0x21 | ||
alert(n.toString(10)); alert(n.toString()); | ||
9��toString() valueOf() | ||
var date = new Date(2011,1,3); | ||
date.valueOf() ���غ�����������ʱ�� | ||
10��js�Ƕ�̬���� var n = 10; ���������ڼ� �Ż�ȷ������������ | ||
11������������ | ||
�����������������ǰ | ||
�����ڶ���ı��� �����Զ���ǰ���������� | ||
12����������scope chain | ||
�ڲ����������ĺ������ڣ�������������������һ���Ƕ��庯�� | ||
�����;ֲ������Ķ��ڶ�����ȫ�ֶ��� | ||
��һ��Ƕ�������ڣ������������������������� | ||
|
||
����һ������ʱ����������һ���������������ú���ʱ��������һ�� | ||
�µĶ���洢���ľֲ���������������������ӵ�������Ǹ��������� | ||
�ϣ�ͬʱ����һ���µĸ����ı�ʾ��������������ġ�����������Ƕ���� | ||
ÿ�ε����ⲿ����ʱ���ڲ����������¶���һ�顣ÿ�ε����ⲿ������ʱ�� | ||
���������Dz�ͬ�ġ� | ||
13��delete in eval void | ||
|
||
������ ��� | ||
|
||
������ ���� | ||
1������Ļ������� create set query delete test enumerate | ||
2��������������� ��д ��ö�� �����ã��Ƿ��ɾ���� | ||
3������Ķ������� | ||
�����ԭ�� prototype | ||
������� ��ʾ�������͵��ַ��� | ||
�������չ��� �Ƿ������������ | ||
//������������ַ��� | ||
4������ֱ���� | ||
var empty = {}; | ||
var point = {x:0,y:0}; | ||
5��new�������� | ||
var o = new Object(); //�ն��� ��{}һ�� | ||
var a = new Array(); | ||
6��Object.create() | ||
var o1 = Object.create({x:1,y:2}); //o1 �̳��Զ���ԭ��{x:1,y:2} | ||
var o2 = Object.create(null); //o2���̳��κ����Ժͷ��� | ||
var o3 = Object.create(Object.prototype); | ||
//�ն���� {} new Object()һ�� | ||
7�����ԵIJ��� ��Ϊ��������Ķ��� | ||
object.property | ||
object["property"] ɢ�� ӳ�� �ֵ� �������� | ||
8���̳� | ||
js�ļ̳�ֻ�ܴӸ����ȡ���Ե�ֵ����������ԭ���� | ||
�������bookΪnull��undefined | ||
book.subtitle.length�ᱨ�� | ||
������� | ||
var len = book && book.subtitle && book.subtitle.length; | ||
|
||
ɾ������ | ||
delete book.subtitle | ||
|
||
������� in hasOwnPreperty() propertyIsEnumerable() | ||
var o = {x:1}; | ||
"x" in o | ||
"toString" in o | ||
|
||
hasOwnPreperty();�ж������Ƿ����Լ��ġ��̳����Է���false | ||
|
||
propertyIsEnumerable() ֻ�����������ԣ�����ö�� | ||
|
||
|
||
��ȡ�������� | ||
Object.keys() | ||
Object.getOwnPropertyNames() | ||
9������getter��setter | ||
var o = { | ||
x: 0, | ||
y: 1, | ||
set r(value) { value = this.r;}, | ||
get r() { return this.x + this.y;} | ||
}; | ||
x�������ԣ�r��ȡ������ | ||
10�����Ե����� ecmascript5 �ϵ�ie��֧�������÷� | ||
�������Ե����ԣ�ֵvalue ��д��writable | ||
��ö��enumerable | ||
������configurable | ||
��ȡ���������ԣ�get set | ||
��ö��enumerable | ||
������configurable | ||
//����{value:1,writable:true,emunerable:true,configurable:true} | ||
Object.getOwnPropertyDescriptor({x:1},x) | ||
//�鲻������ ����undefined | ||
|
||
�������Ե����� �����ļ̳е��������� | ||
Object.defineProperty() | ||
//���ò���ö������ | ||
var o = {}; | ||
Object.defineProperty(o,"x",{ | ||
value:1, | ||
writable:true, | ||
emunerable:false, | ||
configurable:true | ||
}) | ||
|
||
//����ֻ�� | ||
Object.defineProperty(o,"x",{writable:false}) | ||
|
||
�Ķ���������� | ||
Object.defineProperties() | ||
|
||
��չObject.prototype �� P137 | ||
11��������������� | ||
prototype class extensible attribute | ||
|
||
��ѯ�����ԭ�� | ||
ecmascript5�� Object.getPrototypeOf(o1) | ||
ecmascript3�� o1.constructor.prototype | ||
|
||
ͨ������ֱ������new Object()��ʽ�����Ķ��� | ||
����һ��constructor�����ԣ�ָObject()�Ĺ��캯�� | ||
constructor.prototype����������ԭ�� | ||
|
||
p.isPrototypeOf(o)������p�Ƿ���o��ԭ�� | ||
|
||
|
||
//��ȡ��������� �ַ��� | ||
Object.prototype.toString.call(o1).slice(8,-1) | ||
12������Ŀ���չ�� | ||
�����Ƿ�����¼����� | ||
Object.preventExtensions() ���ö�����չ | ||
Object.isExtensible() | ||
Object.seal() ���˽���������Ϊ������չ��������������Ϊ�������� | ||
Object.freeze() | ||
���˽���������Ϊ������չ������������Ϊ�������ã�������������Ϊֻ�� | ||
|
||
��8�� ���� | ||
1����������������� | ||
function t(){ } | ||
t(); �������� this��ȫ�ֶ��� �ϸ�ģʽ����undefined | ||
|
||
var o = {a:function(){}}; | ||
o.a() �������� this�ǵ�ǰ���õĶ��� | ||
2�����캯������ | ||
var o = new Object(); var o= new Object; | ||
o�̳��Թ��캯����prototype���� �ڲ���this�Ǵ˶��� | ||
|
||
var r = new o.m();�е�this����o | ||
3��P184 ������ִ���õ�������������������������Ǻ��������ʱ���ġ� | ||
Ƕ�ĺ���f()���������������������еı���scope�Ǿֲ����� | ||
|
||
|
||
�������� | ||
|
||
����s()����������s��ִ�л���(���ö���),�����ö�������������ͷ�� | ||
Ȼ����t�ĵ��ö���������֮�������ȫ�ֶ���Ȼ���������ͷѰ�ұ���name | ||
|
||
����ss() ss() ==> t() ==> window | ||
name="lwy"; | ||
function t(){ | ||
var name="tlwy"; | ||
function s(){ | ||
var name="slwy"; | ||
console.log(name); | ||
} | ||
function ss(){ | ||
console.log(name); | ||
} | ||
s(); | ||
ss(); | ||
} | ||
t(); | ||
|
||
ÿ�ε��ú�������������һ���µ����������������µ��ڲ����� |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.