existence.js

Summary
existence.js
Functions
is_definedChecks if a variable is undefined.
is_undefinedChecks if a variable is defined.
is_typeofStrict type checking by comparing constructors.
is_numericDetermine if the suspect string represents a numeric value.
is_stringDetermine the suspect is a String.
is_arrayDetermine if the suspect is an Array.
is_numberDetermines if the suspect is a Number.
is_dateDetermines if the suspect is a Date.
is_boolDetermines if the suspect is a Boolean.
is_regexDetermines if the suspect is a RegExp.

Functions

is_defined

var is_defined = function(suspect)

Checks if a variable is undefined.  This is a convenience method to enhance clarity in your conditions.

Parameters

suspectsuspect variable to test

Returns

bool

See Also

is_undefined

is_undefined

var is_undefined = function(suspect)

Checks if a variable is defined.  This is a convenience method to enhance clarity in your conditions.

Parameters

suspectsuspect variable to test

Returns

bool

See Also

is_defined

is_typeof

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

Returns

bool

See Also

is_numeric, is_string, is_array, is_number, is_date, is_bool, is_regex

is_numeric

var is_numeric = function(suspect)

Determine if the suspect string represents a numeric value.  (JavaScript: The Good Parts, Douglas Crockford, O’Reilly p.69 Chapter 7: Regular Expressions An Example) Parameters: suspect - variable to check for numeric value

Returns

bool

See Also

is_number

is_string

var is_string = function(suspect)

Determine the suspect is a String.  This is a proxy method for is_typeof(String, suspect).

Parameters

suspectsupect variable to test

Returns

bool

See Also

is_typeof, is_numeric, is_array, is_number, is_date, is_bool, is_regex

is_array

var is_array = function(suspect)

Determine if the suspect is an Array.  This is a proxy method for is_typeof(Array, suspect).

Parameters

suspectsuspect variable to test

Returns

bool

See Also

is_typeof, is_numeric, is_string, is_number, is_date, is_bool, is_regex

is_number

var is_number = function(suspect)

Determines if the suspect is a Number.  This is a proxy method for is_typeof(Number, suspect).

Parameters

suspectsuspect variable to test

Returns

bool

See Also

is_typeof, is_numeric, is_string, is_array, is_date, is_bool, is_regex

is_date

var is_date = function(suspect)

Determines if the suspect is a Date.  This is a proxy method for is_typeof(Date, suspect).

Parameters

suspectsuspect variable to test

Returns

bool

See Also

is_typeof, is_numeric, is_string, is_array, is_number, is_bool, is_regex

is_bool

var is_bool = function(suspect)

Determines if the suspect is a Boolean.  This is a proxy method for is_typeof(Boolean, suspect).

Parameters

suspectsuspect variable to test

Returns

bool

See Also

is_typeof, is_numeric, is_string, is_array, is_number, is_regex

is_regex

var is_regex = function(suspect)

Determines if the suspect is a RegExp.  This is a proxy method for is_typeof(RegExp, suspect).

Parameters

suspectsuspect variable to test

Returns

bool

See Also

is_typeof, is_numeric, is_string, is_array, is_number, is_bool

var is_defined = function(suspect)
Checks if a variable is undefined.
var is_undefined = function(suspect)
Checks if a variable is defined.
var is_typeof = function(type,
suspect)
Strict type checking by comparing constructors.
var is_numeric = function(suspect)
Determine if the suspect string represents a numeric value.
var is_string = function(suspect)
Determine the suspect is a String.
var is_array = function(suspect)
Determine if the suspect is an Array.
var is_number = function(suspect)
Determines if the suspect is a Number.
var is_date = function(suspect)
Determines if the suspect is a Date.
var is_bool = function(suspect)
Determines if the suspect is a Boolean.
var is_regex = function(suspect)
Determines if the suspect is a RegExp.
Close