DEV Community

Cover image for What can you do with JavaScript(And where does it run)
Karl Esi
Karl Esi

Posted on

What can you do with JavaScript(And where does it run)

What can you do with JavaScript

For a long time, JavaScript was only used in browsers to build interactive web pages. Some developers refer to JavaScript as a toy language. But those days are gone because of huge community support and investments by large companies like Facebook and Google.

This days, you can build full-blown web or mobile apps, as well as real time networking applications like chat and video streaming services, command-line tools, or even games. Here is an example:

A JavaScript game

The next question.

Where does JavaScript code run?

JavaScript was designed to run only in browsers so every browsers has what we call a JavaScript engine that can execute JavaScript code.

JavaScript engine that execute JavaScript code

For example, the JavaScript engines in Firefox and Chrome are SpiderMonkey and V8.

In 2009, a very clever engineer called Ryan Dahl took the open-source JavaScript engine in Chrome and embedded it inside a C++ program. He called that program, node.

Node is a C++ program that includes Google's V8 JavaScript engine. Now with this, we can run JavaScript code out of a browser. So, we can pass our JavaScript code to node for execution. This means, with JavaScript, we can build the back-end for our web and mobile applications.

So, in a nutshell, JavaScript code can be run inside of a browser, or in node. Browsers and node provide a runtime environment for our JavaScript code.

That's it.

You can get my members-only eBook! It's been called "the most practical and informative" Complete HTML, CSS and JavaScript eBook. But it's a well-kept secret. Because it's not sold in every bookstore. The Complete HTML, CSS, and JavaScript eBook(Zero to Mastery) is packed with hands-on advice for understanding HTML, CSS, and JavaScript. From tips, to tricks, and hints, The Complete HTML, CSS, and JavaScript eBook(Zero to Mastery) guides you from beginner to advanced. It's a how-to eBook for people who want to roll up their sleeves and get to work! You can get it here.

I hope you received excellent value in today's article. If you would like to go deeper, head over to My Newsletter, where you can find more great contents that will help you in your productivity, your impact and the quality of your life. I wish you an amazing day.

Top comments (0)