JS: String (class)
What is the Keyword “String”
String is the value of the property key "String" of the Global Object
.
console.assert(globalThis["String"] === String);
Type
Type of String is a function.
console.assert(typeof String === "function");
Parent
Parent of String is Function.prototype.
console.assert(Reflect.getPrototypeOf(String) === Function.prototype);
Purpose
Purpose of String is:
String(value)is used to convert any (primitive or object) value to a string primitive.new String(value)is used to convert any (primitive or object) value to a string object.- Used as a namespace to hold static methods.
- Holds the property key
"prototype". Its value is the parent of all instance of string.
〔see Primitive Value〕
String Constructor
Properties
JavaScript. String
- JS: String Overview
- JS: Quote String
- JS: Apostrophe Delimiter String
- JS: Template String
- JS: String Escape Sequence
- JS: Unicode Escape Sequence
- JS: String Operations
- JS: Iterate String
- JS: String Code Unit
- JS: Count Chars in String 📜
- JS: Tagged Template String
- JS: Regular Expression Functions
- JS: Convert String and Number
- JS: String (class)
- JS: String Constructor
- JS: String.prototype