JS: String Object
What is the Keyword “String”
String
is the value of the property key "String"
of the Global Object
.
window.String === String
Type
Type of String
is a function.
// type of String console.log( typeof String === "function" );
Parent
Parent of String
is Function.prototype.
// parent of String console.log( 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: 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: Regex Functions
- JS: Convert String, Number
- JS: String Object
- JS: String Constructor
- JS: String.prototype