JS: RegExp (class)

By Xah Lee. Date: . Last updated: .

What is the Keyword “RegExp”

RegExp is the value of the property key "RegExp" of the Global Object .

console.assert(globalThis["RegExp"] === RegExp);

Type

Type of RegExp is a function.

// type of RegExp
console.assert(typeof RegExp === "function");

Parent

Parent of RegExp is Function.prototype.

console.assert(Reflect.getPrototypeOf(RegExp) === Function.prototype);

Purpose

Purpose of RegExp is:

Constructor

Properties

JavaScript. Regular Expression