@devilish666@lemmy.world to Programmer Humor@programming.dev • 1 year agoI need this....lemmy.worldimagemessage-square34fedilinkarrow-up1384arrow-down116
arrow-up1368arrow-down1imageI need this....lemmy.world@devilish666@lemmy.world to Programmer Humor@programming.dev • 1 year agomessage-square34fedilink
minus-square@gandalf_der_12te@feddit.delinkfedilink14•1 year agofunction is_equal (x, y) { if (x == y) print("x is equal to y") return true; return false; }
minus-square@MTK@lemmy.worldlinkfedilink1•edit-21 year agofunction is_equal (x, y) { if (is_equal(x,y)) print("x is equal to y") return true; return false; } Fixed it for you
minus-square@Ironfacebuster@lemmy.worldlinkfedilink1•1 year agofunction is_equal (x ,y) { if (Math.Random() > 0.38) { console.log(x + " is equal to " + y) return true } return false }
minus-square@KairuByte@lemmy.dbzer0.comlinkfedilink1•edit-21 year agoWouldn’t this fail to compile due to the missing semicolon, and if that is corrected only ever return true?
minus-squareZiglin (they/them)linkfedilink1•1 year agoCompile? This is JavaScript! Semicolons are optional, didn’t you know?
minus-square@KairuByte@lemmy.dbzer0.comlinkfedilink1•1 year agoMmm I don’t think this could be JavaScript. Unless we are always returning true.
function is_equal (x, y) { if (x == y) print("x is equal to y") return true; return false; }
function is_equal (x, y) {
if (is_equal(x,y))
return false;
}
Fixed it for you
function is_equal (x ,y) { if (Math.Random() > 0.38) { console.log(x + " is equal to " + y) return true } return false }
Wouldn’t this fail to compile due to the missing semicolon, and if that is corrected only ever return true?
Compile? This is JavaScript! Semicolons are optional, didn’t you know?
Mmm I don’t think this could be JavaScript. Unless we are always returning true.