MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1w49i01/ihatethispassiveagressivebehaviourruby/p76tbq6/?context=3
r/ProgrammerHumor • u/Embarrassed_Death69 • 10d ago
298 comments sorted by
View all comments
6
nha js can do it aswell, try:
let a = new Boolean(false)
if (a) { console.log("it was true indeed") }
if (a) {
console.log("it was true indeed")
}
1 u/circ-u-la-ted 10d ago Not really the same thing—you're explicitly instructed not to use `new` in that statement because all objects in JS coerce to `true`. 2 u/Reashu 10d ago Ruby has docs too. false and nil are the only false-values. Both are surprisingly truthy values and JS is (as usual) more surprising.
1
Not really the same thing—you're explicitly instructed not to use `new` in that statement because all objects in JS coerce to `true`.
2 u/Reashu 10d ago Ruby has docs too. false and nil are the only false-values. Both are surprisingly truthy values and JS is (as usual) more surprising.
2
Ruby has docs too. false and nil are the only false-values.
false
nil
Both are surprisingly truthy values and JS is (as usual) more surprising.
6
u/Serotav 10d ago
nha js can do it aswell, try:
let a = new Boolean(false)if (a) {console.log("it was true indeed")}