JPDev to Programmer Humor · 9 months agoExam Answerimagemessage-square129fedilinkarrow-up1798arrow-down111
arrow-up1787arrow-down1imageExam AnswerJPDev to Programmer Humor · 9 months agomessage-square129fedilink
minus-squareFlumPHPlinkfedilinkarrow-up26·9 months ago“Monday”.length is working JavaScript and does equal 6. No print command afaik though.
minus-squaredvlsg@lemmy.worldlinkfedilinkEnglisharrow-up12·9 months agoThere technically is! https://developer.mozilla.org/en-US/docs/Web/API/Window/print Well. In browsers, anyways.
minus-squareScrollone@feddit.itlinkfedilinkarrow-up4·9 months agoYes, but it prints the page, so in this case it wouldn’t print anything
minus-squarePrettyFlyForAFatGuy@feddit.uklinkfedilinkarrow-up8arrow-down1·edit-29 months agofunction print(str) { console.log(str) } FTFY
minus-squarekia@lemmy.calinkfedilinkEnglisharrow-up2·9 months agoYou don’t need terminating semicolons in JavaScript. They’re added in if missing. It can actually cause a few bugs around returns.
“Monday”.length is working JavaScript and does equal 6. No print command afaik though.
There technically is!
https://developer.mozilla.org/en-US/docs/Web/API/Window/print
Well. In browsers, anyways.
Yes, but it prints the page, so in this case it wouldn’t print anything
function print(str) { console.log(str) }
FTFY
deleted by creator
You don’t need terminating semicolons in JavaScript. They’re added in if missing. It can actually cause a few bugs around returns.