Num123; str & quot; 123 & quot; alert (num123); // truealert (str123); // truealert (num123); // true; alert (str123) with the same value and type; // falsealert (typeofnum & quot; number & quot ;);...
Num = 123;
Str = "123 ";
Alert (num = 123); // true
Alert (str = 123); // true
Alert (num = 123); // true; same value and type
Alert (str = 123); // false
Alert (typeof num = "number"); // true
Alert (typeof str = "string"); // true
// The array type is also object
Alert (typeof []); // object
Alert (typeof {}); // object
// Determine whether it is an Array Function
Var isArray = function (obj ){
Return obj &&! (Obj. propertyIsEnumerable ('length') & typeof obj = 'object' & typeof obj. length = 'number ';
};
Arr = [1, 2, 3];
Obj = {a: 1, B: 2, c: 3 };
Alert (isArray (arr); // true
Alert (isArray (obj); // false
Alert (isArray (num); // false
Alert (isArray (str); // false
From the Delphi blog