Lecture 3
Lecture 3
Introduction to JavaScript
D. Munthali- BSc. I.T, MSc. Prog & Sys Arch
CIT-PRG-321- Script Programming
Outline
• Introduction • Control structures
• History • Functions
• Standardisation • Object Oriented
• Executing JS Programming
• Variables • Creating objects
• Datatypes • Manipulating objects
• Operators • The “this” keyword
Outline
• The call and apply • JS Arrays
methods • JS methods
• Getters and setters
• Static members
• Object methods
• Inheritance
• JSON
Introduction
• JavaScript is an interpreted scripting
language
• The interpreters are embedded in web
browsers, need to install an interpreter.
• The primary purpose is to add
interactivity to web pages
• It can also be used for server-side
scripting using Node.js
History
• It was developed by Brendan Eich at
Netscape (Mozilla Corporation) in 1995
• Developed to add interactivity to
NetScape navigator
• There was lack of standards, there
were independent implementations
• There were inconsistences across
browsers
• See “JavaScript wars” Navigator vs IE
Standardisation
• In 1996, Netscape submitted JavaScript
to the European Computer Manufacturers
Association (ECMA) for standardization
• The first version was ECMA script 1- 1997
• ECMAScript 3- released in 1999
• Regular expressions, try-catch exception
handling..
• ECMAScript 5- released in 2009
• Strict mode, JSON support, improved
array manipulation..
Standardisation
• ECMAScript 6 (ES6) – Released in 2015
• Arrow functions, classes, modules
• In 2016 ECMAScript specification transitioned to
an annual release cycle
• ECMAScript 2017
• ECMAScript 2018
• ECMAScript 2019
• ECMAScript 2020
• ….
• ECMAScript 2023
Adding JS to a page
• Inside the script tag