File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11var c = 300
22let a = 400
3- if ( true ) {
3+ if ( true ) { // {}are scope
44 let a = 10
55 const b = 20
66 var c = 30
77 console . log ( "Inner: " , a ) ; //10
88}
99console . log ( a ) //400
1010console . log ( c ) //30
11- console . log ( b ) //error
11+ //console.log(b)//error
12+
13+ function one ( ) {
14+ const username = "kalpjeet"
15+
16+ function two ( ) {
17+ const website = "youtube"
18+ console . log ( username ) ;
19+ }
20+ //console.log(website);// Error
21+ two ( )
22+ }
23+ if ( true ) {
24+ const username = "hitesh"
25+ if ( username == "hitesh" ) {
26+ const website = " youtube"
27+ console . log ( username + website ) ; //hitesh youtube
28+ }
29+ // console.log(website); error
30+ }
31+ //console.log(username); error
32+
33+
34+ //++++++++++++++++++++++++++++++++++++++++++++++++++++
35+
36+ function addone ( num ) {
37+ return num + 1
38+ }
39+ console . log ( addone ( 5 ) ) //6
40+
41+ const addTwo = function ( num ) {
42+ return num + 2
43+ }
44+ console . log ( addTwo ( 5 ) ) //7
You can’t perform that action at this time.
0 commit comments