Type coercion automatically converts values between types during operations. Implicit coercion occurs in comparisons (== vs ===), operations (+, -, etc.). Can lead to unexpected results. Consider explicit type conversion, use strict equality (===). Example: '5' + 2 results in '52' due to string concatenation.
'this' refers to current execution context. In methods, refers to object. In global scope, refers to window/global (non-strict) or undefined (strict). In event handlers, refers to event target. Use bind/arrow functions to maintain context. Consider lexical scope.
Seven primitive types: string, number, boolean, null, undefined, symbol, bigint. Immutable values, passed by value. Each has wrapper object (String, Number, etc.). Consider type checking, conversion methods. Understand differences from objects.
Symbols create unique identifiers. Used for private properties, special methods (Symbol.iterator). Non-enumerable by default. Consider well-known symbols, registration. Handle symbol description.
WeakMap/WeakSet allow garbage collection of keys/values. Prevent memory leaks in certain patterns. No enumeration methods. Consider memory management, use cases. Handle cleanup properly.
Objects inherit properties/methods through prototype chain. Each object has internal [[Prototype]] link. Properties looked up through chain until found or null reached. Use Object.create() or constructor functions. Consider performance, inheritance depth.
Use === for strict equality (type and value). == performs type coercion. Object comparison checks reference. Use Object.is() for NaN, +0/-0. Consider value vs reference comparison. Handle null/undefined cases.
Map allows any type as keys, maintains insertion order. Set stores unique values. Both provide efficient lookup. Consider WeakMap/WeakSet for memory. Handle iteration, conversion methods.
Use libraries (decimal.js), multiplication and division tricks. Handle IEEE 754 limitations. Consider precision requirements. Implement proper rounding. Handle display formatting.
Events propagate through DOM tree. Capturing phase (top-down), target phase, bubbling phase (bottom-up). Control with addEventListener third parameter. Stop propagation with stopPropagation(). Consider event delegation, performance implications.
Scope chain determines variable access. Inner scope can access outer scope variables. Created when function declared. Affects variable lookup performance. Consider lexical scope, closure implications. Handle naming conflicts.
Use Object.defineProperty(), Object.freeze(), Object.seal(). Control property behavior (writable, enumerable, configurable). Consider deep vs shallow immutability. Handle prototype chain.
undefined represents uninitialized value, null represents intentional absence. Different behavior in type coercion, comparisons. Consider type checking, default values. Handle both cases appropriately.
Use get/set keywords, Object.defineProperty(). Control property access/modification. Implement validation, computed properties. Consider performance implications. Handle inheritance.
var has function scope, hoisted with undefined value. let and const have block scope, hoisted but not initialized (temporal dead zone). const prevents reassignment but doesn't make objects immutable. Consider scope implications, use const by default, let when reassignment needed.
Hoisting moves declarations to top of scope during compilation. Function declarations fully hoisted with implementation. var declarations hoisted with undefined value. let/const hoisted without initialization. Consider declaration placement, understand scope rules.
Closure allows function to access variables from outer scope even after outer function returns. Used for data privacy, module pattern, partial application. Maintains state between function calls. Consider memory implications, avoid memory leaks.
Automatic memory management through reference counting and mark-and-sweep. Objects garbage collected when unreachable. Handle memory leaks (closures, event listeners). Consider weak references, cleanup patterns.
Object literals, constructor functions, Object.create(), classes. Each method has different prototype behavior. Consider inheritance needs, performance. Handle property descriptors, initialization patterns.
Use Number.EPSILON for floating-point comparison. Handle IEEE 754 limitations. Consider BigInt for large integers. Use toFixed() for display. Implement proper rounding strategies.
Function declarations, expressions, arrow functions, generator functions. Each has different this binding, arguments handling. Consider hoisting behavior, performance implications. Handle scope appropriately.
Use typeof, instanceof, Object.prototype.toString. Handle null/undefined cases. Consider type coercion rules. Implement proper validation. Handle edge cases appropriately.
Use meaningful names, proper casing (camelCase). Declare variables at appropriate scope. Consider hoisting, block scope. Use const by default. Handle naming conflicts.