existence.js | |
Functions | |
is_defined | Checks if a variable is undefined. |
is_undefined | Checks if a variable is defined. |
is_typeof | Strict type checking by comparing constructors. |
is_numeric | Determine if the suspect string represents a numeric value. |
is_string | Determine the suspect is a String. |
is_array | Determine if the suspect is an Array. |
is_number | Determines if the suspect is a Number. |
is_date | Determines if the suspect is a Date. |
is_bool | Determines if the suspect is a Boolean. |
is_regex | Determines if the suspect is a RegExp. |
var is_typeof = function( type, suspect )
Strict type checking by comparing constructors. (Pro Javascript Techniques, John Resig, Apress p.24 Listing 2-8: Example of using the constructor property to determine the type of an object http://amzn.to/fTsDRg) Parameters: type - The type you expect (ie. String, Number, Array (note: without quotes): is_typeof(String, ‘hello’): // true) suspect - The suspect variable to check against type
bool
is_numeric, is_string, is_array, is_number, is_date, is_bool, is_regex
Checks if a variable is undefined.
var is_defined = function( suspect )
Checks if a variable is defined.
var is_undefined = function( suspect )
Strict type checking by comparing constructors.
var is_typeof = function( type, suspect )
Determine if the suspect string represents a numeric value.
var is_numeric = function( suspect )
Determine the suspect is a String.
var is_string = function( suspect )
Determine if the suspect is an Array.
var is_array = function( suspect )
Determines if the suspect is a Number.
var is_number = function( suspect )
Determines if the suspect is a Date.
var is_date = function( suspect )
Determines if the suspect is a Boolean.
var is_bool = function( suspect )
Determines if the suspect is a RegExp.
var is_regex = function( suspect )