𝔻𝔼𝕍𝕀𝕃𝕀𝕊ℍ@lemmy.world to Programmer Humor@programming.dev · 2 years agoI need this....lemmy.worldimagemessage-square24linkfedilinkarrow-up11arrow-down10
arrow-up11arrow-down1imageI need this....lemmy.world𝔻𝔼𝕍𝕀𝕃𝕀𝕊ℍ@lemmy.world to Programmer Humor@programming.dev · 2 years agomessage-square24linkfedilink
minus-squaregandalf_der_12te@feddit.delinkfedilinkarrow-up0·2 years agofunction is_equal (x, y) { if (x == y) print("x is equal to y") return true; return false; }
minus-squareMTK@lemmy.worldlinkfedilinkarrow-up0·2 years 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-squareKairuByte@lemmy.dbzer0.comlinkfedilinkarrow-up0·2 years agoWouldn’t this fail to compile due to the missing semicolon, and if that is corrected only ever return true?
minus-squareZiglin (it/they)@lemmy.worldlinkfedilinkarrow-up0·2 years agoCompile? This is JavaScript! Semicolons are optional, didn’t you know?
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
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?