Skip to content

Latest commit

 

History

History
85 lines (57 loc) · 3.02 KB

README.md

File metadata and controls

85 lines (57 loc) · 3.02 KB

Basic Info

Name: JavaScript

Creator(s): Brendan Eich

Date: December 4, 1995

Website: ECMA International

Intro

JavaScript often abbreviated as JS, is a programming language that conforms to the ECMAScript specification. JavaScript is high-level, often just-in-time compiled and multi-paradigm. It has dynamic typing, prototype-based object-orientation and first-class functions. Alongside HTML and CSS, JavaScript is one of the core technologies of the World Wide Web. Over 97% of websites use it client-side for web page behavior, often incorporating third-party libraries. All major web browsers have a dedicated JavaScript engine to execute the code on the user's device.

Syntax

Variables in JavaScript can be denoted with the keyword var or the keyword let. Using semicolons at the end of lines is optional.

var language = "JavaScript"
let awsome = true;

Like many other languages If/Else statements in JavaScript use brackets around the condition and curly braces around the body.

if (true) {
  console.log("True!")
} else {
  console.log("False!")
}

The JavaScript for loop follows the initial/condition/after style shown below.

for (var i = 0; i < 10; i++) {
  console.log(i)
}

Functions in JavaScript are denoted with the keyword function followed by the function name and a list of arguments. Arguments can have optional placeholders as shown below.

function addTwoNumbers(num1, num2=42) {
  return num1 + num2
}

Classes in JavaScript are denoted with the keyword class and the constructor method can be defined with the reserved name constructor. New instances of a class are initialized with the keyword new.

class Polygon {
  constructor(width, height) {
    this.width = width
    this.height = height
  }
}

var polygon = new Polygon(10, 20)
console.log("The area of the polygon is: " + polygon.width * polygon.height)

Libraries

  • jQuery ~ A library designed to simplify HTML DOM tree traversal and manipulation.
  • D3 ~ A library for producing dynamic, interactive data visualizations in web browsers.
  • Three ~ A cross-browser library used to create and display animated 3D computer graphics in a web browser using WebGL.

More Info