YoVDO

JavaScript: Best Practices for Code Formatting

Offered By: LinkedIn Learning

Tags

Javascript Courses Style Guides Courses ESLint Courses

Course Description

Overview

Maximize your code's ability to travel and thrive. Learn a core set of practices for creating code that can be read by more people than its creators.

Syllabus

Introduction
  • Modern standards for your JavaScript
  • What you should know
  • Set up your environment
1. Why Best Practices?
  • Style guides
  • Use modern deployment tools
  • ESLint
  • Foundational practice: Use strict mode
2. Creating Comments
  • Use single-line syntax for single lines
  • Multi-line syntax with leading asterisks
  • Include leading spaces in comments
  • Challenge: Create JavaScript comments
  • Solution: Create JavaScript comments
3. Using Punctuation
  • End statements with a semicolon
  • Don't rely on auto semicolon insertion
  • Standardize line length
  • Use commas consistently
  • Include a comma in a list of values
  • Challenge: Optimize punctuation
  • Solution: Optimize punctuation
4. Using Spacing
  • Indent consistently
  • Space before and after operators
  • Use a consistent format for blocks
  • Include a space after keywords and arrows
  • Use consistent spacing before function signature parentheses
  • Break up and indent long-method chains
  • Space consistently within enclosing characters
  • Space after commas, but not before
  • Limit blank space to one line
  • Challenge: Optimize spacing
  • Solution: Optimize spacing
Conclusion
  • Next steps

Taught by

Sasha Vodnik

Related Courses

Programming Languages
University of Virginia via Udacity
Building a Basic Website
University of Massachusetts Amherst via Independent
iDESWEB, Introducción al desarrollo web
Miríadax
Web Engineering II: Developing Mobile HTML5 Apps
Technische Hochschule Mittelhessen via iversity
Web Application Architectures
University of New Mexico via Coursera