jQuery is too overpowering 🙁
String.prototype.trim = function () {
return this.replace(/^(\s| |\u00A0)+|(\s| |\u00A0)+$/g, "");
}
when I try to add the above code, I get “this.replace is not a function”.
I realise that jQuery references itself as this, so how are you meant to reference this?
Problem solved:
I forgot to put the semi colon on the end of the function and it was running in to the jQuery function