“Use Strict” mode
Using strict mode promotes early error detection, enhances code reliability, and encourages best practices in JavaScript development
JavaScript Syntax
Variables: var (global), let (local), or const (local and immutable)
Arrays: [] (elements don’t need to be the same type
Objects: {} (most things in JavaScript are objects)
Functions: ‘function’ and ‘return’ keywords
JavaScript Primitive Types and nuances
-All regular numeric values are stored as floating-point numbers
-String backticks allow for nested variables
-Boolean Falsy (undefined null, false, 0, NaN, ‘’). Everything else truthy
=== For exactly equal (including types)
JavaScript Functions
Functions are first class entities and can be stored and exchanged the same way as any variable
Lambda functions: can construct functions without naming them (useful for compact code that is only referenced once)
Destructuring
Allows expansion on an array or object
E.g.
Const variables = [1, 2, 3, 4];
[a, b, …rest] = variables;
# a=1, b=2, rest = [3,4]
Synchronous programming
Operation blocking: While an operation is being processed, nothing else can happen. Code easy to understand but may lead to inefficiencies
Asynchronous Programming
Effectively handle potential block operations such as: reading/writing files, fetching resources from a server
Need to get notified when an asynchronous operation completes (using callbacks, events, and promises)