1 00:00:00,390 --> 00:00:05,730 In summary, constants are your first option when declaring variables. 2 00:00:05,730 --> 00:00:10,320 They're used to prevent reassignment bugs and to help you debug your code faster. 3 00:00:10,320 --> 00:00:13,200 Const variables have block level scoping. 4 00:00:13,200 --> 00:00:16,620 A block of code is anything between curly braces. 5 00:00:16,620 --> 00:00:19,260 The let keyword is a great substituent for 6 00:00:19,260 --> 00:00:22,510 var when you're wanting to reassign a value. 7 00:00:22,510 --> 00:00:26,380 For example, when you're incrementing an index in a loop or 8 00:00:26,380 --> 00:00:27,840 adding strings together. 9 00:00:27,840 --> 00:00:31,020 This prevents errors when using four loops and 10 00:00:31,020 --> 00:00:33,940 adding dynamic functionality to web pages. 11 00:00:33,940 --> 00:00:37,710 The usage of the var keyword is not recommended anymore, 12 00:00:37,710 --> 00:00:42,045 since there are a number of scoping issues associated with the var keyword. 13 00:00:42,045 --> 00:00:45,780 It's best to start of by declaring variables with const and 14 00:00:45,780 --> 00:00:49,590 then using let as and when you need to re-assign variables. 15 00:00:49,590 --> 00:00:52,290 I hope you've enjoyed this workshop on const and let. 16 00:00:52,290 --> 00:00:56,810 Now you can use these new ways to declare variables to avoid the pitfalls 17 00:00:56,810 --> 00:01:00,220 of programming JavaScript and have better functioning code.