#1 India's Top IT Training Institute
×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
Mentors

Mentors

Meet the industry experts who train and guide you through your course.

Read More →
Free Resources

Free Resources

Free tutorials, interview questions, tools and calculators to help you learn.

Explore →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →
JavaScript Fundamentals

Setting up development environment (with VSCode)

A development environment is the set of tools you use to write, run and test code. For JavaScript, a simple and popular setup is Visual Studio Code (VS Code) as the editor, a modern browser with developer tools, and Node.js for running scripts outside the browser. Setting these up properly from the start saves you from fighting your tools later.

What to install

  1. VS Code, a free code editor available for Windows, macOS and Linux. During installation on Windows, tick the options to add "Open with Code" to the right-click menu and to add VS Code to the PATH.
  2. A current browser such as Chrome, Edge or Firefox. You will use its developer tools constantly.
  3. Node.js, choosing the LTS (long-term support) version. It also installs npm, the package manager used to add tools and libraries.

Checking the installation and creating a project

Open a terminal, or VS Code's built-in terminal with Ctrl and the backtick key, and run:

node -v           # prints the Node.js version, e.g. v20.x
npm -v            # prints the npm version

mkdir js-practice
cd js-practice
code .            # opens this folder in VS Code

# create a file and run it with Node
echo "console.log('Hello from Node');" > hello.js
node hello.js     # Hello from Node

If node or code is "not recognised", close and reopen the terminal so it picks up the new PATH, or restart the computer.

Working in folders, not loose files

Always open a folder in VS Code (File, then Open Folder) rather than a single file. Many features, including search across files, the integrated terminal starting in the right place, and project settings, work properly only when VS Code knows the project root. Keep each project in its own folder with an index.html and a script.js or a src folder.

Extensions worth adding

ExtensionWhy it helps
ESLintUnderlines likely bugs, such as unused variables or undefined names, as you type.
PrettierFormats code consistently so you never align brackets by hand.
Live ServerServes an HTML page on a local address and reloads the browser when you save.
Error Lens (optional)Shows error messages directly on the line where they occur.

Start small. Installing dozens of extensions at once slows the editor down and makes it harder to tell which one changes what.

Settings that make a difference

  • Auto save: File menu, then Auto Save, so changes are written as you go.
  • Format on save: enable editor.formatOnSave in Settings and choose Prettier as the default formatter.
  • Tab size: set to 2 spaces, the common choice in JavaScript projects.
  • Word wrap: turn on with Alt and Z when reading long lines.

A few shortcuts pay off on day one: Ctrl+P to open any file by name, Ctrl+Shift+P for the command palette, Ctrl+/ to comment a line, and Alt+Up or Alt+Down to move a line. On macOS, use Cmd instead of Ctrl.

A setup problem beginners hit

Opening an HTML file by double-clicking it loads it with a file:// address. Simple pages work, but fetch calls and JavaScript modules (<script type="module">) are blocked by the browser for security reasons, which produces confusing CORS errors. Use Live Server, or run a small local server, so the page loads from http://localhost. Another common issue is having two formatters fighting each other on save; pick one default formatter and disable the others for JavaScript.

Ready to code

With VS Code opened on a project folder, Node.js confirmed in the terminal, ESLint and Prettier configured, and Live Server serving your pages, you have a dependable base for every exercise that follows.

Ready to master real-world web development?

Learn HTML, CSS3, Bootstrap and JavaScript hands-on with mentor-led sessions.

Explore Course