Subj : Javascript for dummies like me
To   : Sys64738
From : echicken
Date : Thu Dec 09 2021 02:16 pm

 Re: Javascript for dummies like me
 By: Sys64738 to Digital Man on Wed Dec 08 2021 23:37:59

Sy> No doubt, the tools are far better. However, there doesn't seem to be as
Sy> much consistency in the syntax of the programming languages that I've

True, but there's a diversity of languages because lots of people had their own ideas about how things should work, from syntax down to nuts and bolts.

Sy> observed. Such as with "console.print" as an example. I'm not
Sy> understanding why that command wouldn't be universal and a common command
Sy> within JavaScript.

For whatever reason, JS has a fairly weak standard library and a lot of stuff is left to the implementor. Depending on where your JS is running, the notion of a 'console' to send output to might have a very different meaning.

MDN says that 'console' appeared in browsers around the era of IE8, Firefox 4, Chrome 1, Safari 3. It probably wasn't widespread until at least 10 years ago. Its purpose is mostly to output debug info to a browser's dev tools console. Even then, it's just a convention and not part of the standard.

Meanwhile Synchronet already had an object by that time which (presumably) DM chose to call 'console'. It has a different purpose entirely, even if it seems superficially similar to the 'console' in browsers or node.js.

So, it's an unfortunate coincidence, and just one of those places where the line between standard/core JS and specific implementations gets a bit fuzzy.

---
echicken
electronic chicken bbs - bbs.electronicchicken.com
---
� Synchronet � electronic chicken bbs - bbs.electronicchicken.com