File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed
part1 (Basics)/built-in-objects Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -35,8 +35,3 @@ Converts a JSON string into a javascript object.
3535const jsonStr = '{"name": "Rafay", "age": 25}' ;
3636const parsed = json . parse ( jsonStr ) ;
3737console . log ( parsed . name ) ;
38-
39-
40-
41-
42-
Original file line number Diff line number Diff line change 1+ /*
2+ INFO: Boolean Object
3+ The Boolean object is a wrapper for true or false values. It represents a logical entity and is often used in conditions.
4+ */
5+
6+ // To create a boolean:
7+ let a = true ;
8+ let b = new Boolean ( false ) ; // Boolean object (not recommended)
9+
10+ // Properties of Boolean
11+ Boolean . prototype ; // allows you to add methods to all Boolean instances.
12+
13+ // Methods of Boolean
14+ let x = true ;
15+ console . log ( x . toString ( ) ) ; // "true"
16+ console . log ( x . valueOf ( ) ) ; // true
You can’t perform that action at this time.
0 commit comments