Number objects in JavaScript Assignment Help
Number objects in JavaScript
In javascript number represents integer or floating point numbers. (eg 10 or 5.10 etc.,) The numbers can be directly assigned to variables.
For example,
var x=10;
var area=55.19;
10 and 55.19 are primitive numbers. In java script these primitive numbers can be constructed as Number objects using Number( ) constructor.
Syntax to create number objects”
var variable_name (or) object_name=new Number(value);
Example:
var n=new Number(100);
Now the primitive number ‘100’ treated as Number object.
17.1 Properties of Number objects
Number objects in JavaScript Assignment Help Through Online Tutoring and Guided Sessions at MyAssignmentHelp
Number object has associated properties with it. The properties indicate the minimum acceptable number, maximum number, minimum infinity value and maximum infinity value in java script.
The example program describes the above
![Number Objects number objects img1](https://www.assignmenthelp.net/webimg/ahp/javascript-assignment-help/number-objects-img1.jpg)
17.2 Methods of Number object
Various operations can be performed on Number objects through Methods. Such methods are
![Number Objects number objects img2](https://www.assignmenthelp.net/webimg/ahp/javascript-assignment-help/number-objects-img2.jpg)
Example:
![Number Objects number objects img3](https://www.assignmenthelp.net/webimg/ahp/javascript-assignment-help/number-objects-img3.jpg)
- Namespaces
- Preprocessor Directives
- Regular Expressions
- Exception Handling
- File I/O
- Attributes
- Reflection
- Properties
- Indexers
- Delegates
- Events
- Collections
- Generics
- Anonymous Methods
- Unsafe Code
- Multithreading
- Variables Declarations
- Build In Types
- Operators
- Unary Operators
- Binary Operators
- Array Operations