From the course: JavaScript Code Challenges: Creating Web Apps
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Final touches - JavaScript Tutorial
From the course: JavaScript Code Challenges: Creating Web Apps
Final touches
- [Instructor] All right, our app is working, but it can definitely benefit from some final touches. So let's have a look and refactor it to make it look even better. Okay, let's see. What can I improve? Well, the first thing I noticed is that my theme toggle on line 20, I actually forgot to declare it upstairs, and that's a bad practice. It's still working, though, and that's because browsers automatically creates a global variable with the name of the ID. And since I have the same ID name here, it will work, but it's not a good practice. So, let's go ahead and declare it on top of our file to make sure it's always working, and we won't have to rely on default behavior. So, this is pretty good. There is one thing that's bothered me a little bit. And that's it, I want to have this separately. So I'm going to say here instead, function, handleThemeToggle. And in here, I'm just going to have this line of codes. And instead of having an arrow function here, I'm going to go with…
Contents
-
-
-
-
-
-
-
(Locked)
Introduction: Web-based code editor55s
-
(Locked)
Planning the features1m 3s
-
(Locked)
Creating the UI2m 28s
-
(Locked)
Overview of the necessary JavaScript concepts1m 12s
-
(Locked)
Text area and live preview2m 31s
-
(Locked)
Adding syntax highlighting4m 21s
-
(Locked)
Dark and light mode1m 46s
-
(Locked)
Final touches1m 25s
-
(Locked)
Challenge: Multiple language support2m 5s
-
(Locked)
Solution: Multiple language support2m 8s
-
(Locked)
-