-
Javascript Basics Tutorial
3 Lecutre-
JavaScript – if…else Statement
-
JavaScript – While Loops
-
JavaScript and Cookies
-
-
JavaScript Objects
3 Lecutre-
JavaScript – The Number
-
JavaScript – The Arrays
-
JavaScript – The Date
-
-
JavaScript Advanced
3 Lecutre-
Javascript – Error Handling
-
Javascript – Validations
-
Javascript – Animation
-
-
JavaScript Useful Resources
2 Lecutre
Javascript – Functions
Number Methods
The Number object contains only the default methods that are part of every object’s definition.
Sr.No. | Method & Description |
---|---|
1 | constructor()Returns the function that created this object’s instance. By default this is the Number object. |
2 | toExponential()Forces a number to display in exponential notation, even if the number is in the range in which JavaScript normally uses standard notation. |
3 | toFixed()Formats a number with a specific number of digits to the right of the decimal. |
4 | toLocaleString()Returns a string value version of the current number in a format that may vary according to a browser’s locale settings. |
5 | toPrecision()Defines how many total digits (including digits to the left and right of the decimal) to display of a number. |
6 | toString()Returns the string representation of the number’s value. |
7 | valueOf()Returns the number’s value. |
Boolean Methods
Here is a list of each method and its description.
Sr.No. | Method & Description |
---|---|
1 | toSource()Returns a string containing the source of the Boolean object; you can use this string to create an equivalent object. |
2 | toString()Returns a string of either “true” or “false” depending upon the value of the object. |
3 | valueOf()Returns the primitive value of the Boolean object. |