From 9dfb265c468cf4cb78d712a3b3f080f0fe6da506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdurrahman=20Ayy=C4=B1ld=C4=B1z?= Date: Fri, 5 Aug 2022 20:11:57 +0300 Subject: [PATCH] Update 08_day_objects.md importance of keep using "var" for global variables: https://stackoverflow.com/questions/68432014/uncaught-syntaxerror-identifier-myoptions-has-already-been-declared-in-javasc --- 08_Day_Objects/08_day_objects.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/08_Day_Objects/08_day_objects.md b/08_Day_Objects/08_day_objects.md index 69f5dc4..2741e1b 100644 --- a/08_Day_Objects/08_day_objects.md +++ b/08_Day_Objects/08_day_objects.md @@ -173,7 +173,7 @@ for(let i = 0; i < 3; i++){ ``` -The scope *let* and *const* are the same. The difference is only reassigning. We can not change or reassign the value of the `const` variable. I would strongly suggest you to use *let* and *const*, by using *let* and *const* you will write clean code and avoid hard to debug mistakes. As a rule of thumb, you can use *let* for any value which change, *const* for any constant value, and for an array, object, arrow function and function expression. +The scope *let* and *const* are the same. The difference is only reassigning. We can not change or reassign the value of the `const` variable. I would strongly suggest you to use *let* and *const* for local variables and *var* for global variables, by using *let* and *const* for local variables and *var* for global variables you will write clean code and avoid hard to debug mistakes. As a rule of thumb, you can use *let* and *var* for any value which can change, *const* for any constant value, and for an array, object, arrow function and function expression. ## 📔 Object