React: Building Modern Web Applications
by Jonathan Hayward, Artemij Fedosejev, Narayan Prusty, Adam Horton, Ryan Vice, Ethan Holmes, Tom Bray
Variables and assignment
Variables should be declared with the var keyword. Any variable that is declared outside of a function, or any variable that is used without being declared, is a global variable, and global variables are a big problem; their place in default JavaScript is one of the major design flaws.
When there was a major public relations push for Java, JavaScript was named to run on Java's coattails, and certain decisions were made to make JavaScript code look like Java. These decisions were unfortunate. JavaScript is formally a C-like language and its most recent common ancestor with Java or C# is C, not C++ or Java. JavaScript has been described as being like Scheme in C's clothing. Lisp is a syntax associated with a family of languages ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access