js 基础

Infinity 表示Js中的最大值,对应的 -Infinity;

Another special JavaScript numeric value is returned when a mathematical operation (such as division of zero by zero) yields an undefined result or an error. In this case, the result is the special not-a-number value, printed as NaN. The not-a-number value behaves unusually: it does not compare equal to any number, including itself! For this reason, a special function, isNaN( ), is required to test for this value. A related function, isFinite( ) , tests whether a number is not NaN and is not positive or negative infinity. 

string变量,length, charAt, substring, indexOf

function:

var square = function(x) { return x*x; } 

Functions defined in this way are sometimes called lambda functions in homage to the LISP programming language, which was one of the first to allow unnamed functions to be embedded as literal data values within a program. Although it is not immediately obvious why one might choose to use function literals in a program, we'll see later that in advanced scripts they can be quite convenient and useful. 

 

posted @ 2012-03-26 14:38  lostyue  阅读(181)  评论(0编辑  收藏  举报