SlideShare a Scribd company logo
3
Most read
4
Most read
What is your favorite number?
Is math your favorite subject?
JavaScript
number
object
ROBERT S. PUGAYAN JR.
JavaScript
number
object
ROBERT S. PUGAYAN JR.
The JavaScript number object enables
you to represent a numeric value. It
may be integer or floating-point.
JavaScript number object follows IEEE
standard to represent the floating-point
numbers.
• By the help of Number() constructor,
you can create number object in
JavaScript. For example:
1. var n=new Number(value);
• If value can't be converted to
number, it returns NaN(Not a
Number) that can be checked by
isNaN() method.
JavaScript
number
object
ROBERT S. PUGAYAN JR.
You can direct assign a number to a variable
also. For example:
<script>
var x=102;//integer value
var y=102.7;//floating point value
var z=13e4;//exponent value, output:
130000
var n=new Number(16);//integer value
by number object
document.write(x+" "+y+" "+z+" "+n);
</script>
JavaScript
Number
Constants
Constant Description
MIN_VALUE returns the largest
minimum value.
MAX_VALUE returns the largest
maximum value.
POSITIVE_INFINITY returns positive infinity,
overflow value.
NEGATIVE_INFINITY returns negative infinity,
overflow value.
NaN represents "Not a Number"
value.
JavaScript
Number
Methods
Methods Description
isFinite() It determines whether the given value
value is a finite number.
isInteger() It determines whether the given value
value is an integer.
parseFloat() It converts the given string into a
floating-point number.
parseInt() It converts the given string into an
integer number.
toExponential() It returns the string that represents
exponential notation of the given
number.
toFixed() It returns the string that represents a
number with exact digits after a
decimal point.
toPrecision() It returns the string representing a
number of specified precisions.
toString() It returns the given number in the
form of string.
What have you learned?
01:Identify
what is being
describe.
Constant Description
returns the largest
minimum value.
returns the largest
maximum value.
returns positive infinity,
overflow value.
returns negative infinity,
overflow value.
represents "Not a
Number" value.
01:Identify
what is being
describe.
Methods Description
It determines whether the given value is a finite number.
It determines whether the given value is an integer.
It converts the given string into a floating-point number.
It converts the given string into an integer number.
It returns the string that represents exponential notation of the
given number.
It returns the string that represents a number with exact digits after
after a decimal point.
It returns the string representing a number of specified precisions.
It returns the given number in the form of string.

More Related Content

PDF
Javascript objects, properties and methods .pdf
PPT
Python programming unit 2 -Slides-3.ppt
PDF
accenture Advanced coding questiosn for online assessment preparation
PPTX
CH-3 FEATURES OF PYTHON, data types token
PPTX
Computer programming 2 Lesson 10
DOC
vbscripting
Javascript objects, properties and methods .pdf
Python programming unit 2 -Slides-3.ppt
accenture Advanced coding questiosn for online assessment preparation
CH-3 FEATURES OF PYTHON, data types token
Computer programming 2 Lesson 10
vbscripting

Similar to JavaScript number object.pptx (20)

DOCX
C++ Pointers with Examples.docx
DOCX
R Programming
PPTX
Bsc cs i pic u-4 function, storage class and array and strings
PPTX
GRADE 11 Chapter 5 - Python Fundamentals.pptx
PPTX
python fudmentalsYYour score increaseases
PPT
Lec 02 data representation part 2
PDF
CS-XII Python Fundamentals.pdf
PPTX
vectors.(join ALL INDIA POLYTECHNIC (AICTE)).pptx
PDF
Control Flow Statements and Datatypes in C
PPTX
Btech i pic u-4 function, storage class and array and strings
PDF
Functions torage class and array and strings-
PPTX
DATA TYPE IN PYTHON
PPTX
function, storage class and array and strings
PPTX
TCS_Digital_Advanced_Coding_Student copy.pptx
PPTX
Mcai pic u 4 function, storage class and array and strings
PDF
23UCACC11 Python Programming (MTNC) (BCA)
PDF
C pointers and references
PPTX
Diploma ii cfpc u-4 function, storage class and array and strings
DOC
C important questions
C++ Pointers with Examples.docx
R Programming
Bsc cs i pic u-4 function, storage class and array and strings
GRADE 11 Chapter 5 - Python Fundamentals.pptx
python fudmentalsYYour score increaseases
Lec 02 data representation part 2
CS-XII Python Fundamentals.pdf
vectors.(join ALL INDIA POLYTECHNIC (AICTE)).pptx
Control Flow Statements and Datatypes in C
Btech i pic u-4 function, storage class and array and strings
Functions torage class and array and strings-
DATA TYPE IN PYTHON
function, storage class and array and strings
TCS_Digital_Advanced_Coding_Student copy.pptx
Mcai pic u 4 function, storage class and array and strings
23UCACC11 Python Programming (MTNC) (BCA)
C pointers and references
Diploma ii cfpc u-4 function, storage class and array and strings
C important questions
Ad

More from Steins18 (18)

PPTX
morse code follow up activity for grade 10.pptx
PPTX
morse code follow up activity for grade 10.pptx
PPTX
morse code for grade 10 high schoollearners.pptx
PPTX
orthographic projection for engineering.pptx
PPTX
Shading lecture for learners in highschool.pptx
PPTX
Enum in a Switch Statement learning material.pptx
PPTX
PseudoCoding-enrichment activity for learners02.pptx
PPTX
PseudoCoding-enrichment activity for students.pptx
PPTX
powerpoint workstation intended for learners.pptx
PPTX
POWERPOINT learning materials for students.pptx
PPTX
computer programming: an introduction.pptx
PPTX
introduction program logic Formulation.pptx
PPTX
creating html using notepad-learning material
PPTX
Visual BAsic Softwares intended for ICT students
PPTX
Cookie Attribute.pptx
PPTX
Defining method in JavaScript object.pptx
PPTX
Prototype Object.pptx
PPTX
HTML Attributes.pptx
morse code follow up activity for grade 10.pptx
morse code follow up activity for grade 10.pptx
morse code for grade 10 high schoollearners.pptx
orthographic projection for engineering.pptx
Shading lecture for learners in highschool.pptx
Enum in a Switch Statement learning material.pptx
PseudoCoding-enrichment activity for learners02.pptx
PseudoCoding-enrichment activity for students.pptx
powerpoint workstation intended for learners.pptx
POWERPOINT learning materials for students.pptx
computer programming: an introduction.pptx
introduction program logic Formulation.pptx
creating html using notepad-learning material
Visual BAsic Softwares intended for ICT students
Cookie Attribute.pptx
Defining method in JavaScript object.pptx
Prototype Object.pptx
HTML Attributes.pptx
Ad

Recently uploaded (20)

PDF
Votre score augmente si vous choisissez une catégorie et que vous rédigez une...
PPTX
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
PPTX
retention in jsjsksksksnbsndjddjdnFPD.pptx
PPTX
sac 451hinhgsgshssjsjsjheegdggeegegdggddgeg.pptx
PPTX
Introduction to Inferential Statistics.pptx
PDF
Microsoft Core Cloud Services powerpoint
PPT
Predictive modeling basics in data cleaning process
PPTX
Acceptance and paychological effects of mandatory extra coach I classes.pptx
PPTX
QUANTUM_COMPUTING_AND_ITS_POTENTIAL_APPLICATIONS[2].pptx
PPTX
Topic 5 Presentation 5 Lesson 5 Corporate Fin
PPTX
(Ali Hamza) Roll No: (F24-BSCS-1103).pptx
PPTX
importance of Data-Visualization-in-Data-Science. for mba studnts
PDF
[EN] Industrial Machine Downtime Prediction
PDF
Data Engineering Interview Questions & Answers Batch Processing (Spark, Hadoo...
PPTX
New ISO 27001_2022 standard and the changes
PDF
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
PPTX
Qualitative Qantitative and Mixed Methods.pptx
PDF
Jean-Georges Perrin - Spark in Action, Second Edition (2020, Manning Publicat...
PPTX
A Complete Guide to Streamlining Business Processes
PDF
How to run a consulting project- client discovery
Votre score augmente si vous choisissez une catégorie et que vous rédigez une...
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
retention in jsjsksksksnbsndjddjdnFPD.pptx
sac 451hinhgsgshssjsjsjheegdggeegegdggddgeg.pptx
Introduction to Inferential Statistics.pptx
Microsoft Core Cloud Services powerpoint
Predictive modeling basics in data cleaning process
Acceptance and paychological effects of mandatory extra coach I classes.pptx
QUANTUM_COMPUTING_AND_ITS_POTENTIAL_APPLICATIONS[2].pptx
Topic 5 Presentation 5 Lesson 5 Corporate Fin
(Ali Hamza) Roll No: (F24-BSCS-1103).pptx
importance of Data-Visualization-in-Data-Science. for mba studnts
[EN] Industrial Machine Downtime Prediction
Data Engineering Interview Questions & Answers Batch Processing (Spark, Hadoo...
New ISO 27001_2022 standard and the changes
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
Qualitative Qantitative and Mixed Methods.pptx
Jean-Georges Perrin - Spark in Action, Second Edition (2020, Manning Publicat...
A Complete Guide to Streamlining Business Processes
How to run a consulting project- client discovery

JavaScript number object.pptx

  • 1. What is your favorite number? Is math your favorite subject?
  • 3. JavaScript number object ROBERT S. PUGAYAN JR. The JavaScript number object enables you to represent a numeric value. It may be integer or floating-point. JavaScript number object follows IEEE standard to represent the floating-point numbers. • By the help of Number() constructor, you can create number object in JavaScript. For example: 1. var n=new Number(value); • If value can't be converted to number, it returns NaN(Not a Number) that can be checked by isNaN() method.
  • 4. JavaScript number object ROBERT S. PUGAYAN JR. You can direct assign a number to a variable also. For example: <script> var x=102;//integer value var y=102.7;//floating point value var z=13e4;//exponent value, output: 130000 var n=new Number(16);//integer value by number object document.write(x+" "+y+" "+z+" "+n); </script>
  • 5. JavaScript Number Constants Constant Description MIN_VALUE returns the largest minimum value. MAX_VALUE returns the largest maximum value. POSITIVE_INFINITY returns positive infinity, overflow value. NEGATIVE_INFINITY returns negative infinity, overflow value. NaN represents "Not a Number" value.
  • 6. JavaScript Number Methods Methods Description isFinite() It determines whether the given value value is a finite number. isInteger() It determines whether the given value value is an integer. parseFloat() It converts the given string into a floating-point number. parseInt() It converts the given string into an integer number. toExponential() It returns the string that represents exponential notation of the given number. toFixed() It returns the string that represents a number with exact digits after a decimal point. toPrecision() It returns the string representing a number of specified precisions. toString() It returns the given number in the form of string.
  • 7. What have you learned?
  • 8. 01:Identify what is being describe. Constant Description returns the largest minimum value. returns the largest maximum value. returns positive infinity, overflow value. returns negative infinity, overflow value. represents "Not a Number" value.
  • 9. 01:Identify what is being describe. Methods Description It determines whether the given value is a finite number. It determines whether the given value is an integer. It converts the given string into a floating-point number. It converts the given string into an integer number. It returns the string that represents exponential notation of the given number. It returns the string that represents a number with exact digits after after a decimal point. It returns the string representing a number of specified precisions. It returns the given number in the form of string.