Skip to content

Instantly share code, notes, and snippets.

@rafaelrinaldi
Created March 1, 2011 02:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafaelrinaldi/848476 to your computer and use it in GitHub Desktop.
Save rafaelrinaldi/848476 to your computer and use it in GitHub Desktop.
Easy way to check if a value is unassigned or not.
package tea.util
{
/**
*
* Easy way to check if a value is unassigned or not.
*
* @param p_value Value to check.
* @return True if the value is unassigned, false otherwise.
*/
public function isUnassigned( p_value : * ) : Boolean
{
return Boolean(p_value == null || p_value == undefined || isNaN(p_value) || p_value == Infinity);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment