javascript object oriented programming webinar [read-only]a.netcominfo.com/pdf/javascript object...
TRANSCRIPT
JavaScriptObject Oriented Programming
[ Level-100 Webinar]Meganadha Reddy K.
Technical Trainer
© Meganadha Reddy K., 2014 http://www.netcomlearning.com/
Agenda
• JavaScript Introduction – 5 Mins
• Inbuilt Functions – 5 Mins
• Why JavaScript – 5 Mins
• Object Oriented JavaScript – 35 Mins
• Q&A – 10 Mins
© Meganadha Reddy K., 2014 http://www.netcomlearning.com/
JavaScript Introduction
© Meganadha Reddy K., 2014 http://www.netcomlearning.com/
JavaScript is a full-fledged dynamic programming language that, when applied to an HTMLdocument, can provide dynamic interactivity on websites.
It was invented by Brendan Eich, co-founder of the Mozilla project, the Mozilla Foundation, and the Mozilla Corporation.
Reference : https://developer.mozilla.org
Data Types in JavaScript
• These are primary datatypes in JavaScript:
String
Number
Boolean
Array
Object
© Meganadha Reddy K., 2014 http://www.netcomlearning.com/
How to declare a String Variable?
How to declare a string in JavaScript:
var foo = “meganadh”
In other languages:
String foo = “meganadh”;
© Meganadha Reddy K., 2014 http://www.netcomlearning.com/
Dynamic Typing
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.
That means you don't have to declare the type of a variable ahead of time.
That also means that you can have the same variable as different types.
© Meganadha Reddy K., 2014 http://www.netcomlearning.com/
Data Types (1 of 2)
© Meganadha Reddy K., 2014 http://www.netcomlearning.com/
Reference : https://developer.mozilla.org
Data Types (2 of 2)
Reference : https://developer.mozilla.org
Lets make it clear
© Meganadha Reddy K., 2014 http://www.netcomlearning.com/
JavaScript variables do not have types. The values have types
i.e., same variable can be used for multiple data types.var name = “meganadh” //here it is Stringname =10 //here it is Numbername = true //here it is Boolean
Objects Intro (1 of 2)
© Meganadha Reddy K., 2014 http://www.netcomlearning.com/
JavaScript objects can be thought of a simple collections of name-value pairs.
Object Intro (2 of 2)
function Rectangle(length, breadth){
this.length = length;
this.breadth = breadth;
}
//Define an object
var Board = new Rectangle(10,5);
© Meganadha Reddy K., 2014 http://www.netcomlearning.com/
Object Oriented JavaScript
Demos
© Meganadha Reddy K., 2014 http://www.netcomlearning.com/
Q & A
?
© Meganadha Reddy K., 2014 http://www.netcomlearning.com/