☆ Yσɠƚԋσʂ ☆@lemmy.ml to Programmer Humor@lemmy.mlEnglish · 3 months agoJavaScriptlemmy.mlimagemessage-square16linkfedilinkarrow-up1162arrow-down13cross-posted to: programmer_humor@programming.dev
arrow-up1159arrow-down1imageJavaScriptlemmy.ml☆ Yσɠƚԋσʂ ☆@lemmy.ml to Programmer Humor@lemmy.mlEnglish · 3 months agomessage-square16linkfedilinkcross-posted to: programmer_humor@programming.dev
minus-squareHiddenLayer555@lemmy.mllinkfedilinkEnglisharrow-up17·edit-23 months ago('b' + 'a' + + 'a' + 'a').toLowerCase() Returns “banana”
minus-squaresomedev@aussie.zonelinkfedilinkarrow-up8arrow-down1·3 months agoI’m guessing the + + in the middle returns NaN
minus-squareVictoria@lemmy.blahaj.zonelinkfedilinkEnglisharrow-up4·3 months agoIndeed, the unary plus operator tries to convert whatever is after it to a number if it isn’t already. Since ‘a’ is not a valid number, it returns NaN (not a number)
Returns “banana”
wut
I’m guessing the + + in the middle returns NaN
Indeed, the unary plus operator tries to convert whatever is after it to a number if it isn’t already. Since ‘a’ is not a valid number, it returns NaN (not a number)