From the course: JavaScript: Best Practices for Code Formatting
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Challenge: Optimize spacing - JavaScript Tutorial
From the course: JavaScript: Best Practices for Code Formatting
Challenge: Optimize spacing
(upbeat electronic music) - [Narrator] Ready for a challenge? The start files contain code for a grocery shopping app. Edit the script.js file to implement and enforce best practices for spacing in JavaScript, including indents, spacing around characters and blank lines. This should take you about five minutes. When you're done, join me in the next video and I'll walk you through how I approached it.
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.
Contents
-
-
-
-
-
-
(Locked)
Indent consistently5m 54s
-
(Locked)
Space before and after operators3m 23s
-
(Locked)
Use a consistent format for blocks3m 58s
-
(Locked)
Include a space after keywords and arrows3m 2s
-
(Locked)
Use consistent spacing before function signature parentheses3m 37s
-
(Locked)
Break up and indent long-method chains2m 46s
-
(Locked)
Space consistently within enclosing characters7m 58s
-
(Locked)
Space after commas, but not before2m 14s
-
(Locked)
Limit blank space to one line2m 50s
-
(Locked)
Challenge: Optimize spacing30s
-
(Locked)
Solution: Optimize spacing10m 29s
-
(Locked)
-