SlideShare a Scribd company logo
WT ALA: JavaScript Own Objects
Dhananjaysinh Jhala,
TY CE-1,
Batch B,
170410107027
Index
 Introduction to JavaScript, objects
 JavaScript own objects
 Example
Introduction to JavaScript, objects
 JavaScript is the programming language of HTML and the Web.
 JavaScript is used to program the behavior of web pages.
 Web pages are not the only place where JavaScript is used. Many desktop and server
programs use JavaScript.
 JavaScript variables are containers for data values. But objects can contain many values.
 JavaScript objects are containers for named values called properties or methods.
 E.g. var person = {firstName:“Ian", lastName:“Somerhalder", age:41, eyeColor:"blue"};
 The name:values pairs in JavaScript objects are called properties.
 Objects can also have methods.
JavaScript's own objects
 JavaScript has its own objects. A good example of this is the Math object.
 It has several properties and methods.
 Properties such as PI are accessed as:
 Document. Write(Math.PI); {if you want to print the value of PI}
 The value PI is also known as a constant so it can’t be changed by assignment.
 There are lots of useful methods attached to the Math object too.
 They are accessed in a similar way:
 myValue = Math.round(10.2);
 These have brackets to contain values which are passed to the method.
Math.round()
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript Math.round()</h2>
<p>Math.round(x) returns the value of x rounded to its nearest integer:</p>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML = Math.round(4.4);
</script>
</body>
</html>
JavaScript own objects(Web Technology)
Math.pow(x,y)
Math.pow(x,y) returns the value of x to the power y.
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript Math.pow()</h2>
<p>Math.pow(x,y) returns the value of x to
the power of y:</p>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHT
ML = Math.pow(2,8);
</script>
</body>
</html>
JavaScript own objects(Web Technology)
Other methods of Math object
 Math.sqrt(x) returns the square root of x.
 Math.abs(x) returns the absolute (positive) value of x.
 Math.ceil(x) returns the value of x rounded up to its nearest integer.
 Math.floor(x) returns the value of x rounded down to its nearest integer.
 Math.sin(x) returns the sine (a value between -1 and 1) of the angle x.
 Sly we have Math.cos(x)
 Math.min() and Math.max() can be used to find the lowest or highest value in a list of
arguments.
 Math.random() returns a random number between 0 (inclusive), and 1 (exclusive).
Math constants
 JavaScript provides 8 mathematical constants that can be accessed with the Math
object.
 Unlike other global objects, the Math object has no constructor. Methods and properties are static.
 We also have other methods iike acos, asin, tan, atan, exp…
JavaScript own objects(Web Technology)

More Related Content

Similar to JavaScript own objects(Web Technology) (20)

PDF
3.1 javascript objects_DOM
Jalpesh Vasa
 
PPTX
FYBSC IT Web Programming Unit III Core Javascript
Arti Parab Academics
 
PPTX
In- Built Math function in java script..
anjanasharma77573
 
PPTX
Java script
Shagufta shaheen
 
PDF
Ch 7: Object-Oriented JavaScript
dcomfort6819
 
PPTX
Cordova training : Day 4 - Advanced Javascript
Binu Paul
 
PPS
CS101- Introduction to Computing- Lecture 35
Bilal Ahmed
 
PPTX
Learn java script
Mahmoud Asadi
 
PPTX
Javascript Objects and Functions
Gitanjali wagh
 
PPTX
Javascript Objects and Functions
Manoj \/ishwakarma
 
PPT
9781305078444 ppt ch07
Terry Yoast
 
PPTX
Getting started with ES6
Nitay Neeman
 
PPTX
ExpressionsInJavaScriptkkkkkkkkkkkkkkkkk
kamalsmail1
 
PDF
JavaScript and jQuery - Web Technologies (1019888BNR)
Beat Signer
 
PPTX
WEB222-lecture-4.pptx
RohitSharma318779
 
PDF
Fii Practic Frontend - BeeNear - laborator3
BeeNear
 
PPT
Object Oriented JavaScript
Donald Sipe
 
PPTX
1-JAVA SCRIPT. servere-side applications vs client side applications
surajshreyans
 
PPTX
JavaScript OOPS Implimentation
Usman Mehmood
 
PPTX
Lecture 4- Javascript Function presentation
GomathiUdai
 
3.1 javascript objects_DOM
Jalpesh Vasa
 
FYBSC IT Web Programming Unit III Core Javascript
Arti Parab Academics
 
In- Built Math function in java script..
anjanasharma77573
 
Java script
Shagufta shaheen
 
Ch 7: Object-Oriented JavaScript
dcomfort6819
 
Cordova training : Day 4 - Advanced Javascript
Binu Paul
 
CS101- Introduction to Computing- Lecture 35
Bilal Ahmed
 
Learn java script
Mahmoud Asadi
 
Javascript Objects and Functions
Gitanjali wagh
 
Javascript Objects and Functions
Manoj \/ishwakarma
 
9781305078444 ppt ch07
Terry Yoast
 
Getting started with ES6
Nitay Neeman
 
ExpressionsInJavaScriptkkkkkkkkkkkkkkkkk
kamalsmail1
 
JavaScript and jQuery - Web Technologies (1019888BNR)
Beat Signer
 
WEB222-lecture-4.pptx
RohitSharma318779
 
Fii Practic Frontend - BeeNear - laborator3
BeeNear
 
Object Oriented JavaScript
Donald Sipe
 
1-JAVA SCRIPT. servere-side applications vs client side applications
surajshreyans
 
JavaScript OOPS Implimentation
Usman Mehmood
 
Lecture 4- Javascript Function presentation
GomathiUdai
 

More from Dhananjaysinh Jhala (20)

DOCX
Food donation project report II
Dhananjaysinh Jhala
 
DOCX
Food donation project report I
Dhananjaysinh Jhala
 
PPTX
Coding standard and coding guideline
Dhananjaysinh Jhala
 
PPTX
BCD arithmetic and 16-bit data operations
Dhananjaysinh Jhala
 
PPTX
Design of a two pass assembler
Dhananjaysinh Jhala
 
PPT
Binary search trees
Dhananjaysinh Jhala
 
PPTX
Sleeping barber problem
Dhananjaysinh Jhala
 
PPTX
Email and DNS
Dhananjaysinh Jhala
 
PPTX
Friend function OOPC
Dhananjaysinh Jhala
 
PPTX
applications of first order non linear partial differential equation
Dhananjaysinh Jhala
 
PPTX
concepts of national income
Dhananjaysinh Jhala
 
PPTX
Circular Queue data structure
Dhananjaysinh Jhala
 
PPTX
variable entered map digital electronics
Dhananjaysinh Jhala
 
PPTX
2 phase locking protocol DBMS
Dhananjaysinh Jhala
 
DOCX
Dark sensor using photodiode
Dhananjaysinh Jhala
 
PPTX
Parabola, hyperbola and its applications
Dhananjaysinh Jhala
 
PPTX
1st, 2nd kind improper integrals
Dhananjaysinh Jhala
 
PPTX
Corporate life and skills
Dhananjaysinh Jhala
 
PPTX
type1,2 superconductors
Dhananjaysinh Jhala
 
PPTX
Earthing, grounding and isolation
Dhananjaysinh Jhala
 
Food donation project report II
Dhananjaysinh Jhala
 
Food donation project report I
Dhananjaysinh Jhala
 
Coding standard and coding guideline
Dhananjaysinh Jhala
 
BCD arithmetic and 16-bit data operations
Dhananjaysinh Jhala
 
Design of a two pass assembler
Dhananjaysinh Jhala
 
Binary search trees
Dhananjaysinh Jhala
 
Sleeping barber problem
Dhananjaysinh Jhala
 
Email and DNS
Dhananjaysinh Jhala
 
Friend function OOPC
Dhananjaysinh Jhala
 
applications of first order non linear partial differential equation
Dhananjaysinh Jhala
 
concepts of national income
Dhananjaysinh Jhala
 
Circular Queue data structure
Dhananjaysinh Jhala
 
variable entered map digital electronics
Dhananjaysinh Jhala
 
2 phase locking protocol DBMS
Dhananjaysinh Jhala
 
Dark sensor using photodiode
Dhananjaysinh Jhala
 
Parabola, hyperbola and its applications
Dhananjaysinh Jhala
 
1st, 2nd kind improper integrals
Dhananjaysinh Jhala
 
Corporate life and skills
Dhananjaysinh Jhala
 
type1,2 superconductors
Dhananjaysinh Jhala
 
Earthing, grounding and isolation
Dhananjaysinh Jhala
 
Ad

Recently uploaded (20)

PDF
Design Thinking basics for Engineers.pdf
CMR University
 
PPTX
Element 7. CHEMICAL AND BIOLOGICAL AGENT.pptx
merrandomohandas
 
PPTX
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
PPTX
The Role of Information Technology in Environmental Protectio....pptx
nallamillisriram
 
PPTX
MPMC_Module-2 xxxxxxxxxxxxxxxxxxxxx.pptx
ShivanshVaidya5
 
PDF
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
PPTX
artificial intelligence applications in Geomatics
NawrasShatnawi1
 
PDF
MAD Unit - 2 Activity and Fragment Management in Android (Diploma IT)
JappanMavani
 
PPTX
美国电子版毕业证南卡罗莱纳大学上州分校水印成绩单USC学费发票定做学位证书编号怎么查
Taqyea
 
PDF
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
 
PDF
Biomechanics of Gait: Engineering Solutions for Rehabilitation (www.kiu.ac.ug)
publication11
 
PPTX
UNIT DAA PPT cover all topics 2021 regulation
archu26
 
PPTX
Heart Bleed Bug - A case study (Course: Cryptography and Network Security)
Adri Jovin
 
PPTX
原版一样(Acadia毕业证书)加拿大阿卡迪亚大学毕业证办理方法
Taqyea
 
DOCX
CS-802 (A) BDH Lab manual IPS Academy Indore
thegodhimself05
 
PDF
GTU Civil Engineering All Semester Syllabus.pdf
Vimal Bhojani
 
PPTX
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
 
PPTX
Day2 B2 Best.pptx
helenjenefa1
 
PDF
Water Design_Manual_2005. KENYA FOR WASTER SUPPLY AND SEWERAGE
DancanNgutuku
 
PPTX
Snet+Pro+Service+Software_SNET+Pro+2+Instructions.pptx
jenilsatikuvar1
 
Design Thinking basics for Engineers.pdf
CMR University
 
Element 7. CHEMICAL AND BIOLOGICAL AGENT.pptx
merrandomohandas
 
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
The Role of Information Technology in Environmental Protectio....pptx
nallamillisriram
 
MPMC_Module-2 xxxxxxxxxxxxxxxxxxxxx.pptx
ShivanshVaidya5
 
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
artificial intelligence applications in Geomatics
NawrasShatnawi1
 
MAD Unit - 2 Activity and Fragment Management in Android (Diploma IT)
JappanMavani
 
美国电子版毕业证南卡罗莱纳大学上州分校水印成绩单USC学费发票定做学位证书编号怎么查
Taqyea
 
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
 
Biomechanics of Gait: Engineering Solutions for Rehabilitation (www.kiu.ac.ug)
publication11
 
UNIT DAA PPT cover all topics 2021 regulation
archu26
 
Heart Bleed Bug - A case study (Course: Cryptography and Network Security)
Adri Jovin
 
原版一样(Acadia毕业证书)加拿大阿卡迪亚大学毕业证办理方法
Taqyea
 
CS-802 (A) BDH Lab manual IPS Academy Indore
thegodhimself05
 
GTU Civil Engineering All Semester Syllabus.pdf
Vimal Bhojani
 
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
 
Day2 B2 Best.pptx
helenjenefa1
 
Water Design_Manual_2005. KENYA FOR WASTER SUPPLY AND SEWERAGE
DancanNgutuku
 
Snet+Pro+Service+Software_SNET+Pro+2+Instructions.pptx
jenilsatikuvar1
 
Ad

JavaScript own objects(Web Technology)

  • 1. WT ALA: JavaScript Own Objects Dhananjaysinh Jhala, TY CE-1, Batch B, 170410107027
  • 2. Index  Introduction to JavaScript, objects  JavaScript own objects  Example
  • 3. Introduction to JavaScript, objects  JavaScript is the programming language of HTML and the Web.  JavaScript is used to program the behavior of web pages.  Web pages are not the only place where JavaScript is used. Many desktop and server programs use JavaScript.  JavaScript variables are containers for data values. But objects can contain many values.  JavaScript objects are containers for named values called properties or methods.  E.g. var person = {firstName:“Ian", lastName:“Somerhalder", age:41, eyeColor:"blue"};  The name:values pairs in JavaScript objects are called properties.  Objects can also have methods.
  • 4. JavaScript's own objects  JavaScript has its own objects. A good example of this is the Math object.  It has several properties and methods.  Properties such as PI are accessed as:  Document. Write(Math.PI); {if you want to print the value of PI}  The value PI is also known as a constant so it can’t be changed by assignment.  There are lots of useful methods attached to the Math object too.  They are accessed in a similar way:  myValue = Math.round(10.2);  These have brackets to contain values which are passed to the method.
  • 5. Math.round() <!DOCTYPE html> <html> <body> <h2>JavaScript Math.round()</h2> <p>Math.round(x) returns the value of x rounded to its nearest integer:</p> <p id="demo"></p> <script> document.getElementById("demo").innerHTML = Math.round(4.4); </script> </body> </html>
  • 7. Math.pow(x,y) Math.pow(x,y) returns the value of x to the power y.
  • 8. <!DOCTYPE html> <html> <body> <h2>JavaScript Math.pow()</h2> <p>Math.pow(x,y) returns the value of x to the power of y:</p> <p id="demo"></p> <script> document.getElementById("demo").innerHT ML = Math.pow(2,8); </script> </body> </html>
  • 10. Other methods of Math object  Math.sqrt(x) returns the square root of x.  Math.abs(x) returns the absolute (positive) value of x.  Math.ceil(x) returns the value of x rounded up to its nearest integer.  Math.floor(x) returns the value of x rounded down to its nearest integer.  Math.sin(x) returns the sine (a value between -1 and 1) of the angle x.  Sly we have Math.cos(x)  Math.min() and Math.max() can be used to find the lowest or highest value in a list of arguments.  Math.random() returns a random number between 0 (inclusive), and 1 (exclusive).
  • 11. Math constants  JavaScript provides 8 mathematical constants that can be accessed with the Math object.
  • 12.  Unlike other global objects, the Math object has no constructor. Methods and properties are static.  We also have other methods iike acos, asin, tan, atan, exp…