JavaScript for Beginners (Basics, Resources, Tips and Answers)

Looking to learn more about JavaScript?

You’re in the right place! In this introduction guide I’ll answer common questions like:

  • What is JavaScript?
  • How has JavaScript evolved?
  • What can you do with JS?
  • What are the best places to learn more about JavaScript?

All websites ar built with HTML (a markup language that handles the content on a web page) and CSS (a language to handle the styling of the content).

HTML allows web developers to create all the content and information using HTML tags and providing semantics to the information. The CSS allows you to give some style to the page and build a more pleasant visual interface for the user.

The well-defined separation of these two elements allows you to modify one aspect of the page (the information or the design) without affecting the other.

However, using only and exclusively HTML and CSS on a page limits us considerably.

While it’s true that with these two languages we can do a wide range of things, there are others more complex tasks on a website that we can only do with a proper programming language…

The solution?

Enter JavaScript..

What is JavaScript?

JavaScript (JS) is a programming language and the most common method we use to tell the browser what tasks to perform, in what order and how many times.

JS is the primary programming language in charge of providing more interactivity and dynamism to web pages.

When JavaScript runs in the browser, it can read the code directly, without the need for any additional tool.

This means that JavaScript is recognized as one of the three native languages used in the web together with HTML (content and structure) and CSS (content design and structure).

Brief history of JavaScript

The history of JavaScript begins in the early 1990s, when the Internet started and people could access the Internet thanks to web browsers.

These connections between users and web pages were too slow, and when a user wanted to send information to the server, if it was incorrect, it took a while to know and the data was lost.

Programmers tried to get validations in the browser to minimize loss of information; this was one of the first motivations to create JavaScript, to validate forms.

The programmer Brendan Eich started placing server tasks in the browser in a new version of Netscape Navigator in 1995. This task became more and more ambitious and was called LiveScript.

When Sun Microsystems later bought Nestcape, they named it JavaScript, much like the name of the server-side language (Java) that has absolutely nothing to do with it.

During the Web Browser War in the mid 90s, all browsers were gradually taking the standard — starting with Internet Explorer — and JavaScript became a programming language compatible with all browsers.

Year after year, the language has received modifications and improvements, reaching our era as we actually know it.

Advantages of JavaScript

JavaScript is the primary programming language that works on the browsers natively (language interpreted without the need for compilation). That’s why this language is used as a complement to HTML and CSS to create web pages.

The main advantage of JavaScript is that since it runs on the user’s computer, the effects are executed very fast and with great dynamism. Being a programming language, JavaScript gives the user all the power of programming such as the use of variables, conditionals, loops, etc.

There is also a convenient point: if the user has JavaScript disabled in their browser, the effects won’t be displayed. However, today most of Internet users browse the web with JavaScript enabled.

But there is also advantages for web developers of course: JavaScript offers us greater flexibility and a greater range of possibilities, and if we use it well, they can save us a lot of time.

As example: let’s imagine that we’ve to create a list of numbers from 1 to 500. To do it only with HTML would be very tedious, since we would have to copy and paste these rows several times until we reach 500.

With JavaScript, we can tell the browser that it must write the first paragraph (with a numeric variable ), then write the same one but adding one to the numeric variable. And repeat this until it reaches 500.

Can you see it?

With HTML we’d have to write 500 lines, while with JavaScript it’d be not more than 10 lines, easy and efficient!

What you can do with JavaScript

The JavaScript programming code runs in browsers, whether desktop or mobile, whether Android or iPhone. It works for exactly the same thing, no matter what type of device the browser is running on.

What are some examples of use of JavaScript?

JavaScript is responsible for the existence of tools such as Google Analytics, Google Tag Manager, Facebook Pixel and many others, which are clear examples of JavaScript.

There is also a technology called AJAX that allows an exchange of information with the server without having to reload the page.

In other words, we only load what is necessary from the page. This technology developed in JavaScript has been one of the main advances in web development.

Although we don’t know how to recognize it, it’s thanks to JavaScript that we can get more messages, tweets, emails… just by pressing a button, without having to reload the page.

Resources to learn JavaScript

So now that you have more interest in learning JavaScript, check out these resources in case you want to start learning on your own, and remember:

“Crawl before you walk, walk before you run, and run, run and run before you can fly…”

Codecademy: One of the best places to learn JavaScript online.

freecodeCamp: Looking for free resources? This is your place — and with certifications.

Pluralsight: Pluralsight offers some interesting online courses ideal for beginners.

Coursera: Lots of free and paid courses.

Codementor: Codementor provides great interactive JavaScript tutorials.