File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ const org = 'HowProgrammingWorks' ;
4
+
5
+ // console.log(delete org); // Raises SyntaxError in strict mode
6
+
7
+ const country = {
8
+ name : 'Chile' ,
9
+ ruler : 'Augusto Pinochet' ,
10
+ born : 1915 ,
11
+ alive : false
12
+ } ;
13
+
14
+ delete country . ruler ;
15
+ console . dir ( { country } ) ;
16
+
17
+ console . log ( delete country . born ) ;
18
+ console . log ( delete country . population ) ;
19
+ console . dir ( { country } ) ;
20
+
21
+ const currencies = [ 'BTC' , 'EUR' , 'UAH' , 'USD' ] ;
22
+
23
+ console . log ( 'currencies[1]:' , currencies [ 1 ] , 1 in currencies ) ;
24
+ console . log ( 'currencies[2]:' , currencies [ 2 ] , 2 in currencies ) ;
25
+
26
+ delete currencies [ 1 ] ;
27
+ currencies [ 2 ] = undefined ;
28
+ console . dir ( { currencies } ) ;
29
+
30
+ console . log ( 'currencies[1]:' , currencies [ 1 ] , 1 in currencies ) ;
31
+ console . log ( 'currencies[2]:' , currencies [ 2 ] , 2 in currencies ) ;
You can’t perform that action at this time.
0 commit comments