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)

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

More from Dhananjaysinh Jhala (20)

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

Recently uploaded (20)

Flow Chart Proses Bisnis prosscesss.docx
Flow Chart Proses Bisnis prosscesss.docx
rifka575530
 
operationg systemsdocumentmemorymanagement
operationg systemsdocumentmemorymanagement
SNIGDHAAPPANABHOTLA
 
Decoding Kotlin - Your Guide to Solving the Mysterious in Kotlin - Devoxx PL ...
Decoding Kotlin - Your Guide to Solving the Mysterious in Kotlin - Devoxx PL ...
João Esperancinha
 
Rearchitecturing a 9-year-old legacy Laravel application.pdf
Rearchitecturing a 9-year-old legacy Laravel application.pdf
Takumi Amitani
 
Fundamentals of Digital Design_Class_21st May - Copy.pptx
Fundamentals of Digital Design_Class_21st May - Copy.pptx
drdebarshi1993
 
3. What is the principles of Teamwork_Module_V1.0.ppt
3. What is the principles of Teamwork_Module_V1.0.ppt
engaash9
 
TEA2016AAT 160 W TV application design example
TEA2016AAT 160 W TV application design example
ssuser1be9ce
 
Blood bank management system project report.pdf
Blood bank management system project report.pdf
Kamal Acharya
 
22PCOAM16 _ML_Unit 3 Notes & Question bank
22PCOAM16 _ML_Unit 3 Notes & Question bank
Guru Nanak Technical Institutions
 
FINAL 2013 Module 20 Corrosion Control and Sequestering PPT Slides.pptx
FINAL 2013 Module 20 Corrosion Control and Sequestering PPT Slides.pptx
kippcam
 
Impurities of Water and their Significance.pptx
Impurities of Water and their Significance.pptx
dhanashree78
 
The first edition of the AIAG-VDA FMEA.pptx
The first edition of the AIAG-VDA FMEA.pptx
Mayank Mathur
 
COMPOSITE COLUMN IN STEEL CONCRETE COMPOSITES.ppt
COMPOSITE COLUMN IN STEEL CONCRETE COMPOSITES.ppt
ravicivil
 
A Comprehensive Investigation into the Accuracy of Soft Computing Tools for D...
A Comprehensive Investigation into the Accuracy of Soft Computing Tools for D...
Journal of Soft Computing in Civil Engineering
 
Universal Human Values and professional ethics Quantum AKTU BVE401
Universal Human Values and professional ethics Quantum AKTU BVE401
Unknown
 
362 Alec Data Center Solutions-Slysium Data Center-AUH-Glands & Lugs, Simplex...
362 Alec Data Center Solutions-Slysium Data Center-AUH-Glands & Lugs, Simplex...
djiceramil
 
362 Alec Data Center Solutions-Slysium Data Center-AUH-Adaptaflex.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-Adaptaflex.pdf
djiceramil
 
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
djiceramil
 
ACEP Magazine Fifth Edition on 5june2025
ACEP Magazine Fifth Edition on 5june2025
Rahul
 
4th International Conference on Computer Science and Information Technology (...
4th International Conference on Computer Science and Information Technology (...
ijait
 
Flow Chart Proses Bisnis prosscesss.docx
Flow Chart Proses Bisnis prosscesss.docx
rifka575530
 
operationg systemsdocumentmemorymanagement
operationg systemsdocumentmemorymanagement
SNIGDHAAPPANABHOTLA
 
Decoding Kotlin - Your Guide to Solving the Mysterious in Kotlin - Devoxx PL ...
Decoding Kotlin - Your Guide to Solving the Mysterious in Kotlin - Devoxx PL ...
João Esperancinha
 
Rearchitecturing a 9-year-old legacy Laravel application.pdf
Rearchitecturing a 9-year-old legacy Laravel application.pdf
Takumi Amitani
 
Fundamentals of Digital Design_Class_21st May - Copy.pptx
Fundamentals of Digital Design_Class_21st May - Copy.pptx
drdebarshi1993
 
3. What is the principles of Teamwork_Module_V1.0.ppt
3. What is the principles of Teamwork_Module_V1.0.ppt
engaash9
 
TEA2016AAT 160 W TV application design example
TEA2016AAT 160 W TV application design example
ssuser1be9ce
 
Blood bank management system project report.pdf
Blood bank management system project report.pdf
Kamal Acharya
 
FINAL 2013 Module 20 Corrosion Control and Sequestering PPT Slides.pptx
FINAL 2013 Module 20 Corrosion Control and Sequestering PPT Slides.pptx
kippcam
 
Impurities of Water and their Significance.pptx
Impurities of Water and their Significance.pptx
dhanashree78
 
The first edition of the AIAG-VDA FMEA.pptx
The first edition of the AIAG-VDA FMEA.pptx
Mayank Mathur
 
COMPOSITE COLUMN IN STEEL CONCRETE COMPOSITES.ppt
COMPOSITE COLUMN IN STEEL CONCRETE COMPOSITES.ppt
ravicivil
 
Universal Human Values and professional ethics Quantum AKTU BVE401
Universal Human Values and professional ethics Quantum AKTU BVE401
Unknown
 
362 Alec Data Center Solutions-Slysium Data Center-AUH-Glands & Lugs, Simplex...
362 Alec Data Center Solutions-Slysium Data Center-AUH-Glands & Lugs, Simplex...
djiceramil
 
362 Alec Data Center Solutions-Slysium Data Center-AUH-Adaptaflex.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-Adaptaflex.pdf
djiceramil
 
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
djiceramil
 
ACEP Magazine Fifth Edition on 5june2025
ACEP Magazine Fifth Edition on 5june2025
Rahul
 
4th International Conference on Computer Science and Information Technology (...
4th International Conference on Computer Science and Information Technology (...
ijait
 
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…