What is the super keyword in JavaScript?
The super keyword calls a parent class constructor or method in JavaScript. Learn the rules, with examples for classes, statics and object literals.
Spread Your Knowledge. Questions with answers, tutorials and articles, newest first.
The super keyword calls a parent class constructor or method in JavaScript. Learn the rules, with examples for classes, statics and object literals.
A subclass can replace an inherited method by defining the same name and can reuse the parent version with super. See examples and pitfalls.
null is an intentional empty value and undefined is a missing one. Learn how they differ in comparisons, JSON and modern JavaScript operators.
Use Array.isArray(value) to check whether a JavaScript variable is an array. Compare it with instanceof, typed arrays, array-likes and TypeScript narrowing.
NaN is the number value JavaScript returns for invalid math. Learn what causes it, why it never equals itself and how to test for it safely.
Use instanceof for safe type tests, getClass() for the exact runtime class, and pattern matching in Java 16+ and 21+ to test and cast in one step.
Java has no typeof operator, but instanceof, getClass() and switch type patterns cover every runtime type check. Examples target Java 21 and later.
Learn how to select and identify DOM elements in JavaScript with getElementById, querySelector and querySelectorAll, and how to find the element behind an event.
Use Number.isFinite() for usable numbers, or typeof plus Number.isNaN() when Infinity is fine. Includes numeric string checks and a comparison table.
A TypeScript function type is written (a: number) => string. See aliases, call signatures, optional parameters, generics, overloads and utility types.
A type of element can mean a JavaScript data type or a DOM element type. This guide covers typeof, instanceof, nodeType and input types.
Use typeof value === "string" to detect string primitives in JavaScript, and learn how String wrapper objects, empty strings and TypeScript guards change the check.
typeof, Array.isArray, instanceof and Object.prototype.toString each answer a different question. See which one to use and which pitfalls to avoid.
Check the type of any JavaScript value with typeof, Array.isArray(), instanceof and Object.prototype.toString, and learn the quirks to watch for.
Learn how to check the type of an array item with typeof and instanceof, and how to identify DOM elements with tagName, nodeType, matches and instanceof.
JavaScript has seven primitive types and one object type. This guide covers each type, typeof results, and the difference between value and reference.
Learn which JavaScript check to use for each data type: typeof for primitives, Array.isArray for arrays, instanceof for classes, and a toString helper for everything.
Inside a function, typeof arguments is object, because arguments is array-like but not an array. Learn conversion, rest parameters and arrow function limits.
JavaScript functions are written as declarations, expressions or arrow functions. See how they differ in hoisting, this binding and constructors, with examples.
typeof returns lowercase "string" for string primitives, but "object" for String wrapper objects. Examples and safe string checks.