Before we start learning JavaScript, we need to understand why we should be using programming languages in the first place. It is well known that computers understand binary code, similar to the code below:
00110001 00000000 0000000000110001 00000001 0000000100110011 00000001 0000001001010001 00001011 0000001000100010 00000010 0000100001000011 00000001 0000000001000001 00000001 0000000100010000 00000010 0000000001100010 00000000 00000000
The first computers actually would represent these binary values using thousands of tiny light bulbs with "0" representing the light being off, and "1" representing the light being on. Improvements in technology has made it so that we can store and calculate trillions of these zeros and ones within seconds.
Having a human interact with all those binary numbers is extremely tedious, time consuming, and error prone. So instead of working directly with the 0's and 1's, we write instructions for computers using programing languages.
So instead of working with the following binary values:
000011011000110010100001100100 01101111 0110011101100011 01100001 01110100
We can write them in JavaScript as:
139000"dog""cat"
JavaScript was created by a company called Netscape back in 1995. It was originally called LiveScript, but the name was later changed to JavaScript to capitalize on the popularity of the quickly growing Java programming language. This marketing tactic has caused a lot of confusion throughout the years, leading many to believe that the two languages are related when in fact, they are not.
JavaScript is primarily used to implement complex behavior on web pages, and has gone from being a language used to build simple widgets and interactivity on web pages, to being the foundation of complex and high traffic web applications such as Google Maps, Amazon, and Netflix. Along with that, many tools have been built in recent years to allow JavaScript to be used to program mobile applications, desktop applications, and even small robots!
When it was first released, JavaScript wasn't the only scripting language used in web browsers. Many browsers competed with each other to become the one browser to rule them all, in an era known as the browser wars. Along with this came different scripting languages with varying syntax and ways of interacting with their respective web browsers.
Theses differences made it so that developers had to either write separate versions of their applications for each different browser, or to pick only one or two browsers to run their apps. This lead to a horrible developer and user experience, thus the creation of ECMAScript language specification.
Created by European Computer Manufacturers Association (ECMA), the ECMAScript language specification was used to standardize the languages browsers used. JavaScript was used as the basis of this specification, and this eventually led to the wide adoption of JavaScript in almost all web browsers. ECMA regularly releases updates to ECMAScript which, after a rigorous approval process, eventually ends up getting implemented into web browsers as JavaScript.
You'll hear these different versions referenced by different names. ES5 (ECMAScript version 5) will generally refer to the version of JavaScript used before 2015, and ES6 for implementations of JavaScript used 2015 and onwards.