What is Join() in jquery? for example:
var newText = $(\"p\").text().split(\" \").join(\" \");
The practical use of this construct? It is a javascript replaceAll() on strings.
var s = 'stackoverflow_is_cool'; s = s.split('_').join(' '); console.log(s);
will output:
stackoverflow is cool