JavaScript Introduction

"For a language that was built in 10 days (version 1.0 at least), JavaScript isn't doing too bad for itself."

JavaScript Introduction

JavaScript Beginner series

  1. JavaScript Introduction
  2. Variables and Datatypes

If you’re reading this that means you’re interested in learning JavaScript.

Well, that’s a good choice, and seeing that you’ve embarked on this journey you’ll be excited to know that according to the 2022 Stack overflow developer survey, JavaScript is the most popular programming/scripting language. This has been the case for some time now and it doesn't appear likely to change any time soon.

Enough of that I'm sure you're eager to start learning some JavaScript.

To begin, what is JavaScript?

JavaScript is a dynamic, lightweight computer programming language with object-oriented capabilities. JavaScript is commonly used to build applications that run in your browser and to provide interactivity to web pages.
JavaScript is an interpreted language. This simply means it does not go through a compilation step. What you write is what is executed in the browser.

The use of JavaScript is not limited to your browser. It is also used to build server-side applications through runtime environments such as Node.js and Deno and to build mobile applications through tools such as Cordova, React and React Native.

Another popular use of JavaScript is in building browser extensions. Browser extensions are small programs that add functionality to your browser. These are built using JavaScript, CSS, and HTML.

For a language that was built in 10 days (version 1.0 at least), JavaScript isn't doing too bad for itself.

Someone scrolling on an interactive page.

💡
Fun fact: Before becoming JavaScript, it was previously known as LiveScript and this was changed because of the popularity of Java, another programming language, to ride that wave. Also, it’s syntax is inspired by it.

JavaScript has more benefits among them, it can be used to interact dynamically with the client (e.g., Google Chrome). In short, if the page you’re looking at isn’t simply a static page and has a scroll animation for example or 2D/3D graphics or pop-up modules, you can bet JS is involved.

So now that you’ve got a basic understanding of what JavaScript is and why you may need it, how does it actually run?

JavaScript, unlike other programming languages like C++  and Java, as stated earlier, isn’t compiled prior. Instead, an interpreter inside the browser reads each line, interprets it, and runs it.

Let’s take a webpage for example that we want to manipulate with JavaScript. The browser, for example Google Chrome, takes the code and uses a JavaScript engine (V8 in Chrome or Spider monkey in Firefox) to parse it, compile it and optimize it, then execute it. Keep in mind all this is done on a single thread. So why all these steps? Simply because the compiled machine code is faster and easier to execute by the engine.

There you have it. Now that wasn’t that hard. It only gets better from here. In the following articles, we’ll dive deeper and before you know it, you’ll have a good understanding of JavaScript and be able to use it to create beautiful webpages and Web apps.

If you find this article enjoyable and helpful, you subscribe to my newsletter, Just in Time, it's free and I can send you more nuggets of wisdom like this. It'll help support my work and continue to publish well-curated posts. Thank you!