JPDev@programming.dev to Programmer Humor@programming.dev · 8 months agoExam Answerprogramming.devimagemessage-square129fedilinkarrow-up1792arrow-down111
arrow-up1781arrow-down1imageExam Answerprogramming.devJPDev@programming.dev to Programmer Humor@programming.dev · 8 months agomessage-square129fedilink
minus-squareFlumPHP@programming.devlinkfedilinkarrow-up26·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-squarekia@lemmy.calinkfedilinkEnglisharrow-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.