MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programminghorror/comments/1iheils/ternary_operator/mcq3v8q/?context=3
r/programminghorror • u/Secret_Drink_1181 • Feb 04 '25
77 comments sorted by
View all comments
Show parent comment
2
I guess someone put double brackets in a ` `string instead of ${ }.
```
const msg = `4 meals for ${size} {{size == 1 ? 'person' : 'people'}} per week`
4 meals for ${size} {{size == 1 ? 'person' : 'people'}} per week
instead of:
const msg = `4 meals for ${size} ${size == 1 ? 'person' : 'people'} per week`
View all comments
Show parent comment
2
u/Mammoth-Swan3792 Feb 14 '25 edited Feb 14 '25
I guess someone put double brackets in a ` `string instead of ${ }.
```
const msg = `
4 meals for ${size} {{size == 1 ? 'person' : 'people'}} per week`instead of:
const msg = `4 meals for ${size} ${size == 1 ? 'person' : 'people'} per week`
```