To get the type of a variable:
Compare the type of a variable:
Object.prototype.toString.call( someVar )
Compare the type of a variable:
if( Object.prototype.toString.call( someVar ) === '[object Array]' ) {
alert( 'Array!' );
}
No comments:
Post a Comment