js判断变量是否为空字符串、null、undefined

let _isEmpty = (input) => {
  return input + '' === 'null' || input + '' === 'undefined' || input.trim?input.trim()=== '':input.replace(/^\s+|\s+$/gm,'')==='';
};
posted @ 2018-08-15 18:44  诗和远方-ysk  阅读(4117)  评论(0编辑  收藏  举报