JPDev@programming.dev to Programmer Humor@programming.dev · 9 months agoExam Answerprogramming.devimagemessage-square128fedilinkarrow-up1794arrow-down111
arrow-up1783arrow-down1imageExam Answerprogramming.devJPDev@programming.dev to Programmer Humor@programming.dev · 9 months agomessage-square128fedilink
minus-squareFlumPHP@programming.devlinkfedilinkarrow-up25·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.