Skip to content

Instantly share code, notes, and snippets.

@toddsby
Created October 5, 2016 17:33
Show Gist options
  • Select an option

  • Save toddsby/dc8f8120487dcae87817d86bf6cb97ce to your computer and use it in GitHub Desktop.

Select an option

Save toddsby/dc8f8120487dcae87817d86bf6cb97ce to your computer and use it in GitHub Desktop.
ES6 javascript helper to check for undefined, null, or empty values
/*
* cUN: helper to check for undefined, null, or empty values
**/
export const cUN = ( value ) => {
if ( type of value == 'undefined' || value === '' || value === null || value !== value ) return true;
else return false;
}
@MendyLanda
Copy link

You have a type:
line 5, typeof - not type of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment