Global Objects in Javascript
JavaScript coding is all about objects. This articles will guide you through the global objects used in JavaScript.
What are Global Objects?
Global objects are available at all scope of your JavaScript code. The best part of these objects is that you don’t have to initialized the object.
Properties for Global Objects:
- isNaN
Test a variable to see if it holds Number or Not.
Example<script type="text/javascript"> var test2 = 123; document.write(isNaN(test2)); </script>
Output: false
- Infinity
Checks whether the value from arithmetic expression is infinite.
Methods for Global Objects:
- eval(x)
This command executes the JavaScript code contained within the brackets, in some cases this may return a value which can be assigned to a variable.
Example<script type="text/javascript"> alert(eval(12 + 34 + 56)); </script>
Explanation: This will return 102 and not 123456 as eval command will evaluate the expression.
- parseInt(string,radix)
The parseInt() function parses a string and returns an integer number inside the string. The radix indicates the number system getting used i.e. Decimal, Octal etc. - parseFloat(string)
The parseFloat() function parses a string and returns a floating point number used inside the string. - isNaN(number)
The isNaN() function is used to check if a value is not a number. - isFinite(number)
The isFinite() function is used to check if a value is a finite number.
Similar Posts
Did you enjoy this post? Why not leave a comment below and continue the conversation, or subscribe to my feed and get articles like this delivered automatically to your feed reader.


Hi, my name is disman-kl, i like your site and i ll be back