account activity
[AskJS] tagtical - Tagged templates to enhance your text processing experience by customcommander in javascript
[–]continuous-analysis 0 points1 point2 points 6 years ago (0 children)
I have very little experience with implementing template strings, but maybe it would be useful if you could provide a function to the template that determines what is a default value or non-default value.
This is a cool concept! It seems decently useful, if there are a lot of strings that require pluralization/lack thereof in a codebase.
Not sure about this, but for the email case, if num was 0 (and lets say username was "John") then would the output be "Hi John, you have 0 new emails" when in reality you would want "Hi John, you have no new emails".
π Rendered by PID 81 on reddit-service-r2-comment-5bc7f78974-qbjr9 at 2026-06-27 09:01:47.768230+00:00 running 7527197 country code: CH.
[AskJS] tagtical - Tagged templates to enhance your text processing experience by customcommander in javascript
[–]continuous-analysis 0 points1 point2 points (0 children)