Before moving on to the next exercise, Kyle answers a couple audience questions. When doing so, he talks about use cases for the const keyword he thinks are beneficial. He also talks about using the const keyword with the Object.freeze method.
- [Man] The question was about using const…for immutable values like strings and numbers.…I'm not 100% sure what the question's actually asking.…It's Mark K, about three minutes ago.…- Okay, I think the question is where am I gonna use const?…The place where I think you should use const…is where you are already doing stuff like this.…If you did something silly like var PI equals 3.14…you have my blessing to go change those all to const…'cause those really are immutable values…that you don't intend to reassign…and if you wanna put const on it.…
That's no big deal.…But I don't think you ought to go do like const F…equals arrow function or anything like that…because I think you're just inviting…additional visual clutter…that's not actually communicating…what you think it's communicating.…Okay, yes.…- [Man] What's your take on using const…for function names?…Like let's say you're creating a utility function…and you're calling it add some or something.…- Like I just said I would not do const add some equals…and then some function.…
This course was created by Frontend Masters. It was originally released on 01/10/2017. We're pleased to host this training in our library.
- The arrow function
- Arrow function variations
- Closures and explicit blocks
- Default values
- Using the gather and spread operators
- Dumping variables
- Concise properties and methods
- Symbols, iterators, and generators
- Optimizing codes for the reader
Skill Level Intermediate
1. Arrow Functions
2. Block Scope
3. Default Values and the Gather/Spread Operators
5. Template Strings
6. Symbols, Iterators, and Generators
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.