在Javascript中,array是一个类数组的object。顾名思义,它能够在一个变量上存储多个值。

数组是值的有序集合。每个值叫做一个元素,而每个元素在数组中有一个位置,以数字表示,称为索引。JavaScript数组是无类型:数组元素可以是任意类型,并且同一个数组中的不同元素也可能有不同的类型。 –《JavaScript权威指南(第六版)》

array在一般Javascript object基础上,有自己额外的属性。它采用numbered index作为的key,有一个length property跟踪数组长度,还有如push/popshift/unshift等数组特有操作。

Read more »

Javascript有两种基本数据类型,Primitive和Object。Object是properties的聚合,其property可以是Object也可以是Primitive。Primitive只有value, 没有properties。

Javascript有五种Primitive:

  • string
  • number
  • boolean
  • null
  • undefined

除了nullundefined,其余Primitive都有对应的Object封装,如Object String对应string

Read more »

一门语言的执行,大致经历下面这些过程:词法分析 – 语法分析 – 语义分析 – 中间代码生成 – 优化代码 – 代码生成。在Javascript中,Syntax Parser的作用是进行词法分析语法分析

A program that reads your code and determines what it does and if its grammar is valid.

词法分析挨个字符地扫描代码,把关键token识别出来。语法分析利用词法分析的结果建立上下文关系语法树 Abstract Syntax Tree (AST)。一般情况下,我们不会直接和语法树打交道,但会在进行Uglify代码压缩、IDE语法高亮、Babel重编译、关键字匹配和作用域判断时候涉及到。

Read more »

JavaScript arrays are used to store multiple values in a single variable. The topics covered are summerized below.

  • Creating an Array
  • How to Recognize an Array
  • Array Properties and Methods
    • pop & push
    • shift & unshift
    • splice/join/delete/find/slice
Read more »

This is a repost from here for my reference. Please go to the original post for the most up-to-date information.

What makes a cool URI?
A cool URI is one which does not change.
What sorts of URI change?
URIs don’t change: people change them.

There are no reasons at all in theory for people to change URIs (or stop maintaining documents), but millions of reasons in practice.

Read more »

Linux, Mac, and other Unix-like systems display “load average” numbers. These numbers tell you how busy your system’s CPU, disk, and other resources are. They’re not self-explanatory at first, but it’s easy to become familiar with them.

Read more »


This post is about techniques to manage a Linux system’s virtual memory. The first section discusses commands to check the system’s space usage. The second section shows techniques to use swap files to increase system’s virtaul memory.

Read more »