asarycan

isNullOrWhitespace

Feb 22nd, 2018
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function isNullOrWhitespace(input) {
  2.  
  3.     if (typeof input === 'undefined' || input == null) return true;
  4.  
  5.     return input.replace(/\s/g, '').length < 1;
  6. }
Advertisement
Add Comment
Please, Sign In to add comment