The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
NASA is inviting us to submit our names which they will then, send it to the SUN's surface! This is a part of Parker Solar Probe [^]. The objective of this mission is to study SUN's atmosphere.
Our names won't serve any purpose to the mission! However, I think it will show our support and interest towards these endeavors. Hence I submitted mine. Have you also submitted your name or planning to so? [^]
They should make it more interesting. Instead of a thumb drive, select a politician. And tattoo them, or laser inscribe them, with all the names sent in! Selecting the politician is left for the soap box, though!
set/get is incredibly useful.
this and bind is someone's idea of hell, but once you figure it out, it works.
Being able to pass functions as parameters is incredibly useful, and creating partial functions is also really useful.
It let's you get away with murder. Good grief, I can create/assign a class' function to a completely different function with "=". Well, functions are functions!
It drives me nuts (as with any scripted language) to have to figure out if I wrote the code correctly by actually running it. Things like typos, forgotten this. and other stupid mistakes a compiler would catch. I need to explore some Lint apps.
Dealing with attributes, which are strings, when you want them as numbers to do math on. Ugh. And crazy workarounds, like +"1" is actually the number 1.
Classes are cool, but then there's the "class-like" hack of creating an object with key-value pairs where the key is the function "name" and the value is the function. Is that old school?
var vs. let. Riiight. That was useful to know about.
I haven't even touched what looks like the cesspool of prototype. Probably something I should learn.
Anyways, just thought you'd like all like to know what I've been learning writing my next article on dynamic SVG and creating a bare-bones diagramming app.
> Classes are cool, but then there's the "class-like" hack of creating an object with key-value pairs where the key is the function "name" and the value is the function. Is that old school?
That's one old school way to do it, but it's not quite equivalent. Creating an object where the function names are the keys in the key value pairs is equivalent to creating a class with nothing but static methods in C#. Of course, using ES2017+ syntax, you can just create static functions in your JS class.
In either case, the following code will have exactly the same result:
let something = new MyClass();
The book predates some of the newer syntax, like let, const, and even class. But if you keep in mind that the class syntax is really just using prototypes under the hood, then almost everything in the book will be very relevant to what you're doing now.
One thing the book won't cover is Promises, along with how the new async/await that simplifies using Promises. Its very, very similar to how the async/await syntax in C# makes it easy to work with Tasks.
Last Visit: 5-Jun-20 12:47 Last Update: 5-Jun-20 12:47