You need to have basic understanding of the JavaScript programming language to proceed with the codes from this repository.
JavaScript is a loosely typed or a dynamic language. That means you don't have to declare the type of a variable ahead of time. The type will get determined automatically while the program is being processed. That also means that you can have the same variable as different types:
var foo = 42; // foo is now a Number
var foo = 'bar'; // foo is now a String
var foo = true; // foo is now a Boolean
The latest ECMAScript standard defines seven data types:
-
Six data types that are primitives:
- Boolean (
true
andfalse
) - Null (invalid object or address has the value
null
) - Undefined (a variable that has not been assigned a value has the value
undefined
) - Number (integer and floating point values ranging from -(253 -1) to (253 -1), +Infinity, -Infinity and NaN(not-a-number) )
- String (Sequence of textual characters. Strings are immutable in JavaScript)
- Symbol (new in ECMAScript 6)
- Boolean (
JavaScript Arrays are regular objects for which there is a particular relationship between integer-key-ed properties and the 'length' property. Additionally, arrays inherit from Array.prototype which provides to them a handful of convenient methods to manipulate arrays like indexOf (searching a value in the array) or push (adding an element to the array), etc. This makes arrays a perfect candidate to represent lists or sets.
- JavaScript data types and data structures - Mozilla Developer Network
- A Beginner’s Guide to JavaScript Variables and Datatypes - SitePoint
- Introduction to Object-Oriented JavaScript - Mozilla Developer Network
- OOP In JavaScript: What You NEED to Know - JavaScript is sexy
The easiest way to run and test the codes from this repository is to use nodejs (I have checked my code using nodejs v6.5.0 in an Windows machine).
Install it in your machine and add it to your environment path so that it is accessible in terminal commands.
Then you can run a JavaScript file like this:
node file.js