diff --git a/01_Day_JavaScript_Refresher/01_javascript_refresher.md b/01_Day_JavaScript_Refresher/01_javascript_refresher.md index 7d03fb4..a1dce58 100644 --- a/01_Day_JavaScript_Refresher/01_javascript_refresher.md +++ b/01_Day_JavaScript_Refresher/01_javascript_refresher.md @@ -205,7 +205,7 @@ First, let us write on the head part of the page. 30DaysOfScript:Internal Script @@ -223,7 +223,7 @@ This is how we write an internal script most of the time. Writing the JavaScript @@ -311,6 +311,18 @@ const PI = 3.14 // Not allowed to reassign PI to a new value // PI = 3. ``` +```js +const x = 10; + +if (x > 10) { + const y = 15; +} else { + const y = 20; +} + +console.log(y); // y is not accessible because const and let are block scoped. +``` + ### 2. Data types If you do not feel comfortable with data types check the following [link](https://github.com/Asabeneh/30-Days-Of-JavaScript/blob/master/02_Day_Data_types/02_day_data_types.md)