Download presentation
Presentation is loading. Please wait.
Published byKathryn Charles Modified over 8 years ago
1
JavaScript Justin Skinner Programming Languages
2
JavaScript JavaScript is not Java nor a subset But JavaScript does share the C-family syntax with Java One of the most popular programming language, most web browser now a days has a JavaScript interpreter JavaScript is found in the html code
3
JavaScript: “Hello World” Hello World using JavaScript document.write(“Hello World”)
4
Brief History JavaScript was first known as LiveScript Developed by Brendan Eich in 1995 Standardization http://www.ecma-international.org/publications/standards/Ecma-262.htm
5
Data Types Three primitive types boolean number –NaN (Not a Number) –Infinity string
6
Objects Objects are implemented as hash-tables Objects are just containers of name/value pairs Similarity and differences with Java’s objects Object creations
7
Example Creating Objects Nested Objects Object literal notation var student = new Object(); student.name = “Mary Jane”; student.finalgrade = “A”; student.finalgrade.testgrade = “B”; student.finalgrade.homeworkgrade = “A”; var students = {name: “Mary Jane", finalgrade: “A”};
8
Functions Like C functions, except they have a keyword function instead of a type Calling the functions doesn’t require a fixed number of parameters Supports inner function Can have anonymous functions Functions are first class objects in JavaScript
9
The END!! Any Questions?
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.