JavaScript - The Number Object Full Details
JavaScript - The Number Object Full Details
जावास्क्रिप्ट - Number Object पूर्ण विवरण
नंबर ऑब्जेक्ट संख्यात्मक तिथि का प्रतिनिधित्व करता है, या तो पूर्णांक या फ़्लोटिंग-पॉइंट नंबर। सामान्य तौर पर, आपको संख्या वस्तुओं के बारे में चिंता करने की आवश्यकता नहीं है क्योंकि ब्राउज़र स्वचालित रूप से संख्या अक्षर को संख्या वर्ग के उदाहरणों में बदल देता है।
Syntax -वाक्य - विन्यास
एक संख्या वस्तु बनाने के लिए वाक्य रचना इस प्रकार है -
var val = new Number(number);
संख्या के स्थान पर, यदि आप कोई गैर-संख्या तर्क प्रदान करते हैं, तो तर्क को संख्या में परिवर्तित नहीं किया जा सकता है, यह NaN (No-a-Number) देता है।
Number Properties -संख्या गुण
यहां प्रत्येक संपत्ति और उनके विवरण की एक सूची दी गई है।
Sr.No. | Property & Description |
---|---|
1 | The largest possible value a number in JavaScript can have 1.7976931348623157E+308 |
2 | The smallest possible value a number in JavaScript can have 5E-324 |
3 | Equal to a value that is not a number. |
4 | A value that is less than MIN_VALUE. |
5 | A value that is greater than MAX_VALUE |
6 | A static property of the Number object. Use the prototype property to assign new properties and methods to the Number object in the current document |
7 | Returns the function that created this object's instance. By default this is the Number object. |
Number Methods -संख्या के तरीके
Sr.No. | Method & Description |
---|---|
1 | Forces a number to display in exponential notation, even if the number is in the range in which JavaScript normally uses standard notation. |
2 | Formats a number with a specific number of digits to the right of the decimal. |
3 | Returns a string value version of the current number in a format that may vary according to a browser's local settings. |
4 | Defines how many total digits (including digits to the left and right of the decimal) to display of a number. |
5 | Returns the string representation of the number's value. |
6 | Returns the number's value. |