Check if string is empty with trim - Node.js String

Node.js examples for String:Trim

Description

Check if string is empty with trim

Demo Code


/**/*from ww w  .  j  a v  a  2 s. c om*/
         * Check if string is empty with trim
         * @param {string}
*/
isEmpty: function(value) {
   return (value === '' || (value == null) || (value.length === 0) || /^\s+$/.test(value));
}

Related Tutorials