标签:des http io ar os sp for java strong
true
or false
.length
. Similar to a basic object, an array can be created with the Array
constructor or the shorthand syntax known as array literal [].jQuery.isFunction( myValue ); // false
jQuery.isPlainObject( myValue ); // false
jQuery.isArray( myValue ); // true
// Values that evaluate to false:
false
"" // An empty string.
NaN // JavaScript‘s "not-a-number" variable.
null
undefined // Be careful -- undefined can be redefined!
0 // The number zero.
Truthy:
// Everything else evaluates to true, some examples:
"0"
"any string"
[] // An empty array.
{} // An empty object.
1 // Any non-zero number.
for ( [initialization]; [conditional]; [iteration] ) {
[loopBody]
}
while ( [conditional] ) {
[loopBody]
}
do {
[loopBody]
} while ( [conditional] )
a
is before b
, and if it is greater than zero it‘s vice-versa. If the return value is zero, the elements‘ index is equal..join()
creates a string representation of an array by joining all of its elements using a separator string.length
property is used to determine the amount of items in an array// Function declaration.
function foo() {
// Do something.
}
// Named function expression.
var foo = function() {
// Do something.
};
(function() {
var foo = "Hello world";
})();
if ( Object.prototype.toString.call( myArray ) === "[object Array]" ) {
// Definitely an array!
// This is widely considered as the most robust way
// to determine if a specific value is an Array.
}
this
is a special keyword that is used in methods to refer to the object on which a method is being invokedFunction.call()
or Function.apply()
, this
will be set to the first argument passed to .call()
/.apply()
. If the first argument passed to .call()
/.apply()
is null
or undefined
, this
will refer to the global object (which is the window
object in web browsers).Function.bind()
, this
will be the first argument that was passed to .bind()
at the time the function was created.this
will refer to that object.this
will refer to the global object.window
object标签:des http io ar os sp for java strong
原文地址:http://www.cnblogs.com/dmdj/p/4149297.html