From the course: JavaScript: Best Practices for Functions and Classes
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Solution: Create classes - JavaScript Tutorial
From the course: JavaScript: Best Practices for Functions and Classes
Solution: Create classes
(upbeat music) - [Instructor] To start out, I've opened up my index.html file in the browser and in the console, I have my mailing label format working the way I expect. So I just want to go through at this point and clean up the code to use best practices, there's no errors right now that are preventing things from working, but I want to be able to make these changes without actually breaking anything. First of all, I want to make sure I'm implementing Pascal case. You can see right here in my class that I've defined it with all lower case, just not what I want. So I'll start off over in my ESLint RC file and add new-cap with an error as the result and that flags for me the usage. I need to actually go up and notice that I have to change the definition in order to be able to then change the usage, and now that error is gone. Now, another this related rule that ESLint can handle for me is invalid this, which is using…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.