2018-03-20 10:26 pm
Entry tags:

newish JavaScript syntax

Some stuff for me to learn.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Grammar_and_types#Object_literals

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment

My initial reaction to some of those examples is stunned disbelief. Why would you want to allow defining a property whose name is an empty string, an exclamation mark, or a number? And why would you use array syntax, [], for those, when they aren't arrays? So that "car[7]" is not necessarily the 7th item in a car array, but might be a car property by the name of 7?

Yeah. How fun.
2012-01-22 10:56 pm
Entry tags:

JavaScript reference

A Survey of the JavaScript Programming Language - a very good high-level overview of JavaScript, for programmers who are already familiar with other languages.

I thought I was already fairly knowledgeable about JavaScript, but it has many neat features that I wasn't previously aware of.