MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1bjjkm6/arejsdevsactuallysane/kvrql69/?context=3
r/ProgrammerHumor • u/jarulsamy • Mar 20 '24
554 comments sorted by
View all comments
Show parent comment
18
new RegExp({})
| ↓
new RegExp([object Object])
new RegExp('[object Object]')
5 u/AbsolutelyFreee Mar 20 '24 This is fucking absurd 10 u/Cley_Faye Mar 20 '24 The middle step is wrong. {} is directly converted to a string with {}.toString(), which indeed results in [object Object]. Writing new RegExp([object Object]) is incorrect. 13 u/Lumethys Mar 20 '24 It is like a thought flow, not a compiling step. Or else I would just write the whole OP post back
5
This is fucking absurd
10
The middle step is wrong. {} is directly converted to a string with {}.toString(), which indeed results in [object Object]. Writing new RegExp([object Object]) is incorrect.
{}
{}.toString()
[object Object]
13 u/Lumethys Mar 20 '24 It is like a thought flow, not a compiling step. Or else I would just write the whole OP post back
13
It is like a thought flow, not a compiling step. Or else I would just write the whole OP post back
View all comments
Show parent comment
18
u/Lumethys Mar 20 '24
new RegExp({})new RegExp([object Object])new RegExp('[object Object]')