Like learning a musical instrument, programming requires daily practice.
There are some tools that will help you to write code. One of these, Prettier, formats your code, making it easier for you and others to read.
- In Visual Studio open the extensions panel (see https://code.visualstudio.com/docs/editor/extension-gallery#_browse-and-install-extensions)
- Search for
Prettier - Code formatter
- Click install on the top result
- In Visual Studio open the settings file (see https://code.visualstudio.com/docs/getstarted/settings#_creating-user-and-workspace-settings)
- Search for
editor format
- Set
editor.formatOnSave
andeditor.formatOnPaste
to true