devilish666@lemmy.world to Programmer Humor@programming.dev · 9 months agoI need this....lemmy.worldimagemessage-square26fedilinkarrow-up1383arrow-down116
arrow-up1367arrow-down1imageI need this....lemmy.worlddevilish666@lemmy.world to Programmer Humor@programming.dev · 9 months agomessage-square26fedilink
minus-squaregandalf_der_12te@feddit.delinkfedilinkarrow-up14·9 months agofunction is_equal (x, y) { if (x == y) print("x is equal to y") return true; return false; }
minus-squareMTK@lemmy.worldlinkfedilinkarrow-up3arrow-down2·edit-29 months 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-squareIronfacebuster@lemmy.worldlinkfedilinkarrow-up1·9 months agofunction is_equal (x ,y) { if (Math.Random() > 0.38) { console.log(x + " is equal to " + y) return true } return false }
minus-squareKairuByte@lemmy.dbzer0.comlinkfedilinkarrow-up1·edit-29 months agoWouldn’t this fail to compile due to the missing semicolon, and if that is corrected only ever return true?
minus-squareZiglin@lemmy.worldlinkfedilinkarrow-up1·8 months agoCompile? This is JavaScript! Semicolons are optional, didn’t you know?
minus-squareKairuByte@lemmy.dbzer0.comlinkfedilinkarrow-up1·8 months 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.