@devilish666 to Programmer [email protected] • 9 months agoI need this....imagemessage-square26arrow-up1380arrow-down116
arrow-up1364arrow-down1imageI need this....@devilish666 to Programmer [email protected] • 9 months agomessage-square26
minus-square@[email protected]linkfedilink13•9 months agofunction is_equal (x, y) { if (x == y) print("x is equal to y") return true; return false; }
minus-square@[email protected]linkfedilink1•edit-29 months agoWouldn’t this fail to compile due to the missing semicolon, and if that is corrected only ever return true?
minus-square@Ziglinlink1•8 months agoCompile? This is JavaScript! Semicolons are optional, didn’t you know?
minus-square@[email protected]linkfedilink1•8 months agoMmm I don’t think this could be JavaScript. Unless we are always returning true.
minus-square@MTKlink1•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-square@Ironfacebusterlink1•9 months agofunction is_equal (x ,y) { if (Math.Random() > 0.38) { console.log(x + " is equal to " + y) return true } return false }
function is_equal (x, y) { if (x == y) print("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.
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 }