4 ms·
I am currently building a web app and I've found myself doing a lot of string concatenation. What are these more robust and better-abstracted methods? I would
by dopamean 14y ago
I am currently building a web app and I've found myself doing a lot of string concatenation. What are these more robust and better-abstracted methods? I would love to read up on them. Thanks.
- nickzoic 14y agoDo you mean doing things (in jQuery) like: $('<div id="' + identifier + '">' + some_text + '</div>'); If so, consider doing: $('<div>').attr('id', identifier).text(some_text); which handles escaping correctly for you. Or equivalent in your preferred JS framework or lack of framework.