In #JavaScript, is it good practice to write bi-di #RegExp, e.g., to match prices /(€|£|₪|د.\ع)/g? Note the escaped '.'. TIA! (CC: @mathias)
-
-
@mathias Once at runtime, yes. Should say that it is on a node.js server upon server start, not on the client. Still bad practice? -
@tomayac For libraries and client-side code, I like to inline stuff at build time to avoid the perf hit. https://github.com/mathiasbynens/he/blob/a9c6187967693bff7fd94250d4a19c7a7faeb9c8/src/he.js#L41-L53 … - 1 more reply
New conversation -
-
-
@mathias My main argument for doing it is in 1:50 of your video. Readability and maintainability. Plus it's on the server.Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.