How do you practice javascript?

How do you practice javascript?

Introduction

Learning and practising JavaScript is always fun. But sometimes while practicing, we get exhausted because every time we make some changes into the code, we have to go back to browser and reload it. After that, we have to see its console for the output. This whole process is distractive and time consuming. I was also having the same experience when I was learning JavaScript but then I came to a solution which I want to share with my readers. I found this way very simple and easy. By following this method, I give much more time to understanding JavaScript concepts instead of refreshing the browser.

Things we will use

  • Sublime Text
  • iTerm
    〰 You can use any text-editor or terminal of your choice
  • NodeJS
    〰 To run JavaScript outside the browser.
  • Nodemon Plugin

⚠️ Nodemon is a utility that will monitor for any changes in your source and automatically restart your server. Perfect for development.

Let’s Start!

  • First Open Sublime Text editor and open your project into it by dragging and then dropping the project folder on its window or by selecting project folder by selecting File > Open….
  • Then open iTerm and change directory to your project directory.
  • Then, add nodemon.json file at the root of your project and the following data into that file.
{
"events": {
"start": "clear"
}
}

We are clearing the console before executing the file. It will give us a clear console and a distraction free environment. So, for that we are binding clear command with start event of nodemon.

📚 Click to know more about nodemon events ?

  • Then, run your JavaScript file by executing following command into the terminal:
nodemon --quiet YOUR_FILENAME.js

What it will do is, it will watch your file for changes and execute that file if any changes are made. --quiet will disable nodemonlogs in order to provide you distraction free output.

  • Now open both of them side-by-side and start writing code, hit ctrl+S.
    ( cmd + S in case of macOS ) to save the file and see the output simultaneously.

⚠️ If you are using macOSX, you can split both of them into a separate window. If will provide you a complete distraction free environment. If you are using linux or windows, you can resize them and keep them side-by-side.

How do you practice javascript?

That’s it!!

This was a problem that I had and then I tried to solve it. Now just write your code and then just hit ctrl + S and the output of that code is in front of you. Just spend your time on thinking about the problem not about how to test it.

Now go and practice like a pro 👍

This method is something similar to this

If you like this article, please give it some claps 👏 and share it! If you do not like this post or have any type of questions regarding anything that I mentioned in this post. Feel free to ask me. Just post an issue in my “Ask Me Anything” by clicking here.

For more like this, follow me on Medium or Twitter. To ask a Question visit this link. More about me on my website.

How do you practice javascript?

Don’t forget to 👆subscribe our weekly-newsletter service for web hackers. All latest articles and stuff like trending repositories, straight to your mailbox 📬.

How can we practice JavaScript?

More videos on YouTube.
Build Javascript Projects. ... .
Improve Existing Projects. ... .
Complete Code Challenges. ... .
Join an Open Source Project. ... .
Join the Coding Community. ... .
Share your Javascript Learning Journey with Others. ... .
Write Coding Articles and Share Knowledge..

How do I practice JavaScript in my browser?

If you want to practise on your computer: You should use code editor to make some sample code of HTML, CSS and Javascript. Use HTML to link with CSS and Javascript. Once the code ready, double click the HTML file, it should then open on your default browser.

How many hours should I practice JavaScript?

4–5 practice days a week with around 3–4 hours at a time.

What is a best practice JavaScript?

Modularize — one function per task This is a general programming best practice — making sure that you create functions that fulfill one job at a time makes it easy for other developers to debug and change your code without having to scan through all the code to work out what code block performs what function.