JavaScriptReflect.getOwnPropertyDescriptor(target, key) returns an own property's descriptor or undefined. It lets you inspect a property's value, accessors, and attributes without searching the prototype chain.
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptReflect.getPrototypeOf(target) returns an object's immediate prototype or null. It requires an object: primitive values cause a TypeError rather than the wrapper conversion performed by Object.getPrototypeOf.
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScript`Reflect.has(target, propertyKey)` returns a boolean. When the object and its entire prototype chain consist of ordinary objects, it distinguishes a missing property from an existing own or inherited property, even if its value is `undefined`. A `Proxy` object's `has` trap can change the result.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptReflect.isExtensible(target) checks whether an object is extensible. For an ordinary object, extensibility means that new own properties can be added. The method returns a boolean and throws TypeError for primitive values.
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptReflect.ownKeys(target) requires an object. For an ordinary object, it returns an array of all own string and symbol keys, including non-enumerable ones, and excludes inherited properties. A Proxy's ownKeys trap can change which keys are returned.
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptReflect.preventExtensions(target) prevents new own properties from being added to an object and returns a Boolean result. It does not freeze existing properties and can still throw exceptions.
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptReflect.set performs a property assignment operation and returns a boolean indicating success. Its optional receiver separates the object where property lookup begins from the recipient of the write.
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptReflect.setPrototypeOf(target, proto) attempts to set an object's prototype and returns a boolean result. It distinguishes a rejected change from invalid arguments, which cause TypeError.
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptRegExp.prototype.exec searches for a match and returns an array containing the matched text and captures, or null. The g and y flags make successive calls use and update lastIndex.
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptThe flags property returns a regular expression's flags as a string in a fixed order, regardless of their order at creation. It is an accessor without a setter, not a method.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptlastIndex stores the next search position for regular expressions with g or y. It is a writable property of each RegExp instance, not a prototype property.
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptThe source property returns a RegExp pattern's text without enclosing slashes or flags. Use it to inspect a pattern or reconstruct an expression with new RegExp(), passing its flags separately.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptThe test() method checks whether a regular expression matches text and returns true or false. The g and y flags make matching use lastIndex, so repeated calls can produce different results.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptSet.prototype.add(value) adds a single value to a set if it is not already present. It mutates the existing Set and returns that same object, allowing calls to be chained.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptSet.prototype.clear() removes every element from an existing Set and returns undefined. It mutates the same object, so every reference to that object observes the emptied collection.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptSet.prototype.delete(value) removes the specified value from an existing set. It returns true if removal occurred, or false if the value was absent. Objects are matched by identity rather than by their contents.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptThe difference() method returns a new Set containing elements of the receiving set that are absent from the other set. It preserves their order and does not itself modify the input sets.
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptSet.prototype.entries() returns an iterator of [value, value] pairs in insertion order. The first position is not an index: Set stores no separate keys. Consume the iterator with next(), for...of, or spread syntax.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptSet.prototype.forEach calls a function for set values in insertion order. It passes the value twice and the set itself, and the method returns undefined.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptSet.prototype.has checks whether a set contains a given value and returns true or false. It does not modify the set; values are compared using SameValueZero, and objects are compared by identity.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptThe intersection(other) method returns a new Set containing values shared by both collections. Result order depends on the operands’ sizes; other may also be an object exposing the set-like interface.
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptSet.prototype.isDisjointFrom checks whether a set has no elements in common with another set or a set-like object. It returns a Boolean rather than creating a new set.
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptSet.prototype.isSubsetOf checks whether every element of a set occurs in another set or set-like object. It returns a boolean; equal sets also satisfy this condition.
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptThe isSupersetOf() method checks whether a Set contains every element of another set-like collection. It returns a boolean; equal sets also satisfy the condition, so this is not a proper-superset test.
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support