Even though ES6 introduced the class keyword, JavaScript's object system is built on prototypes. The prototype chain is how JavaScript looks up a property: if it is not found on an object itself, the engine looks on the object's prototype, then the prototype's prototype, and so on. This chain is what powers inheritance and is the reason methods can be shared across many objects. A common mistake is to confuse JavaScript prototypes with classical classes in languages like Java or C#—they look similar but differ in how inheritance actually works under the hood.
The ES6 class syntax is essentially syntactic sugar on top of prototypes. A class is defined with class MyClass { constructor(props) { this.props = props; } method() {} }. Class inheritance uses extends to create a child class and super() inside the child's constructor to call the parent constructor, ensuring the parent's initialization runs first. The this keyword refers to the execution context object: it points to window in the global scope, to the calling object inside regular methods, and is inherited from the surrounding lexical scope inside arrow functions.
JavaScript ships with many built-in objects for everyday tasks. The Math object offers utilities such as Math.random(), Math.floor(), and constants like Math.PI, with no constructor of its own. The Date object represents a moment in time and is created with new Date() for the current instant or new Date('2023-01-01') for a specific one; methods like getFullYear() and setHours() read and update parts of the date. JSON (JavaScript Object Notation) is a plain-text format for data interchange, written like {"name": "JS"}, and is converted to and from JavaScript objects with JSON.parse() and JSON.stringify(). Array methods such as map(), filter(), and reduce() provide functional-style transformations: map() builds a new array by applying a function to each element, filter() keeps only elements that pass a boolean test, and reduce() folds an array down to a single accumulated value.