Add the following code to add trim functionality to the string.
if ( typeof String.prototype.trim !== 'function' ) {
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g, '');
}
}
Add the following code to add trim functionality to the string.
if ( typeof String.prototype.trim !== 'function' ) {
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g, '');
}
}