I believe there's a more powerful function in JS, which is String.prototype.replace. You can use it to replace static or even dynamic parts in strings or parse regular strings into arrays or objects:
let jar = {};
document.cookie.replace(/([^=; ]+)=([^;]+)/g, (_, key, val) => { jar[key] = val; });
You can even use it to do basic syntax highlighting of regular languages (might be a bit difficult with more recent ECMAscript versions): gist.github.com/atk/1084980
Now that's what I call powerful.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I believe there's a more powerful function in JS, which is
String.prototype.replace
. You can use it to replace static or even dynamic parts in strings or parse regular strings into arrays or objects:You can even use it to do basic syntax highlighting of regular languages (might be a bit difficult with more recent ECMAscript versions): gist.github.com/atk/1084980
Now that's what I call powerful.