惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
The GitHub Blog
The GitHub Blog
美团技术团队
Know Your Adversary
Know Your Adversary
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The Register - Security
The Register - Security
Stack Overflow Blog
Stack Overflow Blog
Attack and Defense Labs
Attack and Defense Labs
G
Google Developers Blog
I
InfoQ
博客园 - 司徒正美
T
Troy Hunt's Blog
Google DeepMind News
Google DeepMind News
J
Java Code Geeks
MongoDB | Blog
MongoDB | Blog
博客园 - 聂微东
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
S
Security Affairs
M
MIT News - Artificial intelligence
Simon Willison's Weblog
Simon Willison's Weblog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
T
Tailwind CSS Blog
量子位
Vercel News
Vercel News
月光博客
月光博客
V
Vulnerabilities – Threatpost
N
News and Events Feed by Topic
Hugging Face - Blog
Hugging Face - Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
L
LangChain Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
L
LINUX DO - 最新话题
F
Full Disclosure
The Hacker News
The Hacker News
Hacker News: Ask HN
Hacker News: Ask HN
T
Tor Project blog
A
Arctic Wolf
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Forbes - Security
Forbes - Security
IT之家
IT之家
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Y
Y Combinator Blog
GbyAI
GbyAI
B
Blog RSS Feed
V
Visual Studio Blog
T
The Blog of Author Tim Ferriss
F
Fortinet All Blogs

博客园 - microsheen

[MDX学习笔记之五]优化Set操作——SUM中的CrossJoin [MDX学习笔记之四]Where vs. Subselect/Subcube [MDX学习笔记之三]MDX的上下文(Context) [MDX学习笔记之二]在MDX中处理边界情况 SQL Server 2005 SP2 CTP 在11月7号发布了 [MDX学习笔记之一]MDX中一些常见的计算 SSAS中Cube的结构 如何使用MDX编写同比和环比 SQL Server2005对XML的支持 2006 Tech.Ed 第二天见闻 2006 Tech.Ed 第一天见闻 C#简单命名指南 [.net泛型学习笔记之三]再测泛型的性能 [.net泛型学习笔记之二]泛型的性能 [.net泛型学习笔记之一]泛型介绍 [设计模式学习笔记之二]设计模式和量体剪衣 Note Three: studying JavaScript: The Definitive Guide, 4th Edition Note Two : studying JavaScript: The Definitive Guide, 4th Edition [设计模式学习笔记之一]面向对象是什么?
Note One —— studying JavaScript: The Definitive Guide, 4th Edition
microsheen · 2006-02-04 · via 博客园 - microsheen

The followings are some logs after I read some chapters of JavaScript: The Definitive Guide, 4th Edition.

Chapter 1.  Introducation to JavaScript
1. What's JavaScript
1)JavaScript Is Not Java : the two languages are entirely unrelated. The similarity of names is purely a marketing ploy (the language was originally called LiveScript; its name was changed to JavaScript at the last minute).
2)JavaScript Is Not Simple : JavaScript is easy to use for  new and unsophisticated programmers, but it is a full-featured programming language, as complex as any and more complex than some

2.Versions of JavaScript
There are many versions of JavaScript. JavaScript 1.0, 1.1, 1.2 is provided by Netscape. JScript 1.0-5.5 is provided by Microsoft. ECMA v1-v3 is provided by ECMA which is a public organize.

3. Client-Side JavaScript
JavaScript is not only for Client-Side. When a JavaScript interpreter is embedded in a web browser, the result is client-side JavaScript. JavaScript is language like other languages, for example, c++, Java, so it can be executed in everywhere in theory. That is to say, JavaScript is a general-purpose programming language; its use is not restricted to web browsers

4. JavaScript Security
Client-side JavaScript programs cannot read local files or perform networking operations.

Chapter 2. Lexical Structure
Optional Semicolons :  Simple statements in JavaScript are generally followed by semicolons (;),  but you may omit the semicolon if each of your statements is placed on a separate line.

Chapter 3. DataTypes and Values
1. Primitive Data Type :
There are three primitive data types in JavaScirpt,  there are Numbers, Strings, Boolean.

Primitive data types are not objects. The truth is that a corresponding object class is defined for each of the three key primitive data types. That is, besides supporting the number, string, and boolean data types, JavaScript also supports Number, String, and Boolean classes. These classes are wrappers around the primitive data types. A wrapper contains the same primitive data value, but it also defines properties and methods that can be used to manipulate that data.

2. Numbers
Special numeric constants :
Infinity :  Special value to represent infinity
NaN :  Special not-a-number value
Number.MAX_VALUE : Largest representable number
Number.MIN_VALUE : Smallest (closest to zero) representable number
Number.NaN : Special not-a-number value
Number.POSITIVE_INFINITY : Special value to represent infinity
Number.NEGATIVE_INFINITY : Special value to represent negative infinity

3. Strings
In some implementations of JavaScript, individual characters can be read from strings (but not written into strings) using array notation, so the earlier call to charAt( ) could also be written like this:

last_char = s[s.length - 1];
Note, however, that this syntax is not part of the ECMAScript v3 standard, is not portable, and should be avoided.

4. Functions
A function is a piece of executable code that is defined by a JavaScript program or predefined by the JavaScript implementation.  There are three forms of defining functions.
1) function square(x) { return x*x; }
2) var square = function(x) { return x*x; }
3) var square = new Function("x", "return x*x;");

5. Objects
Objects in JavaScript have the ability to serve as associative arrays -- that is, they can associate arbitrary data values with arbitrary strings. That is to say, image["width"] = image.width.

you can define objects like following forms.
var point = { x:2.3, y:-1.2 };
var rectangle = { upperLeft: { x: 2, y: 2 },   lowerRight: { x: 4, y: 4}   };
var square = { upperLeft: { x:point.x, y:point.y },  lowerRight: { x:(point.x + side), y:(point.y+side) }};

6. Arrays
you can define objects like following forms.
var a = new Array( );
var a = new Array(1.2, "JavaScript", true, { x:1, y:3 });
var a = [1.2, "JavaScript", true, { x:1, y:3 }];
var matrix = [[1,2,3], [4,5,6], [7,8,9]];
var base = 1024;  var table = [base, base+1, base+2, base+3];
var sparseArray = [1,,,,5];

7. null and undeifned
the undefined value returned when you use either a variable that has been declared but never had a value assigned to it, or an object property that does not exist.

Although null and the undefined value are distinct, the == equality operator considers them to be equal to one another. Consider the following:

my.prop == null

This comparison is true either if the my.prop property does not exist or if it does exist but contains the value null. Since both null and the undefined value indicate an absence of value, this equality is often what we want. However, if you truly must distinguish between a null value and an undefined value, use the === identity operator or the typeof operator (see Chapter 5 for details).

Unlike null, undefined is not a reserved word in JavaScript. The ECMAScript v3 standard specifies that there is always a global variable named undefined whose initial value is the undefined value.

8. Date, Error, Regular Expression
you can use like the following:
var xmas = new Date(2000, 11, 25);  
/^HTML/
/[1-9][0-9]*/
/\bjavascript\b/i