JPDev@programming.dev to Programmer Humor@programming.dev · 8 months agoExam Answerprogramming.devimagemessage-square128fedilinkarrow-up1794arrow-down111
arrow-up1783arrow-down1imageExam Answerprogramming.devJPDev@programming.dev to Programmer Humor@programming.dev · 8 months agomessage-square128fedilink
minus-squareFlumPHP@programming.devlinkfedilinkarrow-up25·8 months ago“Monday”.length is working JavaScript and does equal 6. No print command afaik though.
minus-squaredvlsg@lemmy.worldlinkfedilinkEnglisharrow-up12·8 months agoThere technically is! https://developer.mozilla.org/en-US/docs/Web/API/Window/print Well. In browsers, anyways.
minus-squareScrollone@feddit.itlinkfedilinkarrow-up4·8 months agoYes, but it prints the page, so in this case it wouldn’t print anything
minus-squarePrettyFlyForAFatGuy@feddit.uklinkfedilinkarrow-up8arrow-down1·edit-28 months agofunction print(str) { console.log(str) } FTFY
minus-squarekialinkfedilinkEnglisharrow-up2·8 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.