Boolean
Boolean is the built-in object corresponding to the primitive Boolean data type. JavaScript boolean can have one of two values: true or false.
Primitive Values
var primitiveTrue = true;
var primitiveFalse = false;
Boolean Function
var functionTrue = Boolean(true);
var functionFalse = Boolean(flase);
Boolean Constructor
var constructorTrue = new Boolean(true);
var constructorFalse = new Boolean(false);
Boolean
If value parameter is omitted or is 0, -0, null, false, NaN, undefined, or the empty string (“”), the object has an initial value of false.
String
A string is a built-in object corresponding to the primitive string data type.
A string is a group of characters.
String
Primitive
var str = “Hello DevopsSchool”;——————————
var str = „Hello DevopsSchool‟; ——————————String
var str = Hello DevopsSchool
;—————————–
Constructor
var str = new String (“Hello DevopsSchool”);——————————
var str = new String („Hello DevopsSchool‟); —————————– Object
var str = new String (Hello DevopsSchool
);—————————–
Accessing String
Access String
String Concatenation
Concat Operator
Template Literal/ Template Strings
Template literals are string literals allowing embedded expressions. You can
use multi-line strings and string interpolation features with them.
Template literals are enclosed by the back-tick () character instead of double
or single quotes.
Multiple Line String
String Interpolation
Template literals can contain placeholders. These are indicated by the dollar sign and curly braces
(${expression})
String Methods
- charAt ( )
- charCodeAt( )
- toUpperCase( )
- toLowerCase ( )
- Trim( )
- Replace ( )
- Split ( )
- indexOf( )
- Search ( )
- Slice ( )
- Substring( )
- Substr ()
- AWS Error: Access denied by EC2 Instance Connect - December 4, 2023
- How to get Blackduck Trial version? - December 3, 2023
- PHP ionCube Error: cannot be decoded by this version of the ionCube Loader - December 2, 2023