Introduction to JavaScript
Tags: beginners, javascript
Published: 2019-12-16 13:45:16

---
title: Introduction to JavaScript
published: true
description: A beginners introduction to JavaScript
tags: beginners, javascript
series: FrontEnd Development Zero to Hero
cover_image: https://thepracticaldev.s3.amazonaws.com/i/uijbli227lukr4i94ld9.jpg
---
> __Cover photo by [Irvan Smith](https://unsplash.com/@mr_vero) on [Unsplash](https://unsplash.com)__

The _JavaScript_ programming language is one of the __cornerstone technology__ of the web alongside <abbr title="Hypertext Markup Language">HTML</abbr> and <abbr title="Cascading Style Sheets">CSS</abbr>. _JavaScript_ is mainly used to add behavior to web pages like animations and dialog boxes but, over the years its usage has eclipsed "adding behaviors to web page" and it's now used to create fully fledged <abbr title="User Interface">UI</abbr> using tools like [ReactJS](https://reactjs.org/) and [VueJS](https://vuejs.org/) and you can also find JavaScript on the [server side](https://en.wikipedia.org/wiki/Server-side) in the form of [NodeJS](https://nodejs.org/en/).

JavaScript like most [programming languages](https://en.wikipedia.org/wiki/Programming_language) is a tool in a developers toolkit and like all tools, it is used to [solve programming problems](https://en.wikipedia.org/wiki/Problem_solving) or tasks if it fits the [specific domain](https://en.wikipedia.org/wiki/Domain-specific_language). Our domain of interest in this section of the [series](https://dev.to/ziizium/frontend-development-zero-to-hero-j0j) is the <abbr title="World Wide Web">WWW</abbr> or the _web_ for short and _JavaScript_ fits nicely because it was originally designed for the web.

It is quiet easy to get started with _JavaScript_ with so many resource on the internet most notably <abbr title="Mozilla Developer Network">[MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript)</abbr> and as you go deeper in learning JavaScript you will realize its quiet a forgiving language and beginner friendly and it contains some features that'll do some house keeping for you like [automatic semicolon insertion](https://2ality.com/2011/05/semicolon-insertion.html).

If you read the the previous paragraphs and you wonder why i mentioned ReactJS, VueJS and automatic semicolon insertion, take a deep breath and exhale. How do you feel? I hope you feel better. You should not worry much because we wont get that deep while learning _JavaScript_ in this section and moreover this is an introduction.

The _JavaScript_ we'll discuss are just the basics to get you started, we'll talk about the following (and more):

* Variables
* Arrays
* Objects
* Functions
* Conditional Statements

The list above is just some of the things you'll find in most [high level programming languages](https://en.wikipedia.org/wiki/High-level_programming_language) and we'll discuss them in a way you can easily digest them.

Furthermore, our discussion we'll focus mainly on using _JavaScript_ on a web page and we'll talk about the <abbr title="Document Object Model">DOM</abbr> and how to manipulate it using <abbr title="Application Programming Interface">API's</abbr> like:

* [document.getElementByID](https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementById)
* [document.getElementsByClassName](https://developer.mozilla.org/en/docs/Web/API/Document/getElementsByClassName)

We'll also talk about <abbr title="Asynchronous JavaScript and XML">Ajax</abbr> and our main coding environment will be the _Developer Tools_ and your _favorite text editor_.

###__Beginner related questions__
The following are questions commonly asked by beginners getting started with _JavaScript_.

__Question__: What is JS?
__Answer__: JS is short for JavaScript.

__Question__: Is _JavaScript_ the same as _Java_?
__Answer__: No. JavaScript is not the same as Java and both language have different syntax and uses.

__Question__: Can you mention one main difference  between both languages?
__Answer__: _JavaScript_ is an [interpreted language](https://en.wikipedia.org/wiki/Interpreted_language) and Java is a [compiled language](https://en.wikipedia.org/wiki/Compiled_language).

__Question__: If i know _JavaScript_ can i easily pick up Java?
__Answer__: It depends on your learning capabilities and if the project you are working on requires Java. But, __I'll advise you to learn a language only if you have a project that you want to implement and of one its requirement is to learn the language__.

With this you will be _learning with a purpose_ which is one of the _best way to learn_ because every time you are learning parts of the language you will be thinking about how to apply it to your project and when you do, there is a high chance _you wont forget what you've learned_ and you will have _an experience on the implementation details_ which is an added bonus.

__Question__: How can i save my _JavaScript_ file?
__Answer__: With the `.js` extension.

<hr>

But, before we start coding lets take a look at some history lesson. That's next.