Category Archives: JavaScript

JavaScript Arrays and HTML Collections

So for the longest time, I’ve always been told that JavaScript only has one array type:
the Array Object
.

// Generally, these are all the same
var arrVehicleTypes=new Array();
arrVehicleTypes[0]="Economy";
arrVehicleTypes[1]="Compact";
arrVehicleTypes[2]="Luxury";
arrVehicleTypes[3]="Sports";
arrVehicleTypes[4]="Van";
var arrVehicleTypes=new Array('Economy', 'Compact', 'Luxury', 'Sports', 'Van');

Continue reading

Posted in JavaScript | Leave a comment

IsTypeOf Function

The IsTypeOf function is design to allow you to type identify any object.


/*
/////////////////////////////////////////////////////////////////////////////////////////////////////
//  IsTypeOf                                                                             IsTypeOf  //
/////////////////////////////////////////////////////////////////////////////////////////////////////
*/
IsTypeOf=function(obj,_strict) {
  if(obj==null||obj===undefined){return null;}

Continue reading

Posted in JavaScript | Tagged | Leave a comment