FormattersLesson 9Free preview
JS Formatter
This lesson is part of Web Developer Tools · All levels
Summary
JS Formatter refines JavaScript code by adding indentations, spaces, and new lines according to the block structure. Code that was once compressed in one line became easier to track, especially when looking for paired curly braces. The formatter does not change the logic of the program or fix bugs; it just sets the display. The content of the string and the template literal should remain exactly the same after the process.
Key points
- Add the indentation, spacing, and new line to the JavaScript code
- Helps read the resulting code minify or copy-paste
- No change in logic, variable name, or bug fix
- The content of the string and the template literal must not change
- Use an automated formatter in the editor to make the code style consistent
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.