IS Array validation in javascript

var playerKills = 5;

if( Object.prototype.toString.call( playerKills ) === '[object Array]' ) {
    alert( 'Array!' );
}else{ alert('No');}

Share this

Related Posts

Previous
Next Post »

Pageviews from the past week