js logo

Introduction

EcmaScript by JavaScript

Ciprian Chichirita

ciprian.chichirita@tellence.net
Contents
  1. Definition
  2. Hello World
  3. Some OOP principles
  4. JavaScript intro
  5. Homework
  6. Resources
Definition

JavaScript was created by Netscape’s Brendan Eich in 1995. It was originally intended as a simpler scripting language for websites, complementing the use of Java for more complex web applications, but its tight integration with Web pages and built-in support in browsers has caused it to become far more common than Java in web frontends.

JavaScript isn’t just limited to web browsers, though: Node.js, a project that provides a standalone runtime for Google Chrome’s V8 JavaScript engine, is becoming more and more popular.

Definition

JavaScript often abbreviated as JS, is a high-level, interpreted programming language that conforms to the ECMAScript specification. It is a programming language that is characterized as dynamic, weakly typed, prototype-based and multi-paradigm.

dynamic (vs static): a variable initially bound to a number may be reassigned to a string

weakly typed (vs strongly): type are distinguish in a weakly manner (looser typing rules and may produce unpredictable results or may perform implicit type conversion at runtime)

prototype-based (vs classic oop): In JavaScript, an object is an associative array, augmented with a prototype. JavaScript uses prototypes where many other object-oriented languages use classes for inheritance.

multi-paradigm: event-driven, functional, and imperative (including object-oriented and prototype-based) programming styles.

Vanilla JS is plain JavaScript code

Hello World
								
									
								
							
Some OOP principles

Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data, in the form of fields (often known as attributes or properties), and code, in the form of procedures (often known as methods or functions).

  • Classes (blueprint)
  • Object (instance of a blueprint)
  • Property
  • Method
  • Function
  • Procedure
  • void aka nothing
  • Variable
  • Class variables (static)
  • Instance variables
  • Member variables (global var)
  • Class methods (static)
  • Instance methods
  • Class members
Some OOP principles

Class-based vs prototype-based

  • In class-based languages the classes are defined beforehand and the objects are instantiated based on the classes.
  • In prototype-based languages the objects are the primary entities. No classes even exist. The prototype of an object is just another object to which the object is linked. Every object has one prototype link (and only one).
JavaScript intro

										
											
										
									
JavaScript intro

										
											
										
									
JavaScript intro

										
											
										
									
JavaScript intro

										
											
										
									
JavaScript intro

										
											
										
									
JavaScript intro

										
											
										
									
Homework

Resources