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

let _isEmpty = (input) => {
  return input + '' === 'null' || input + '' === 'undefined' || input.trim?input.trim()=== '':input.replace(/^\s+|\s+$/gm,'')==='';
};

猜你喜欢

转载自www.cnblogs.com/ysk123/p/9483276.html