Thursday, January 26, 2012

join() isNAN() methods

join() Method in JavaScript
Joins all array elements into a single string separated by the specified delimiter.

Syntax: arrayName.join(param);

JavaScript Code:
<script language="javascript">
function joinfun()
{
 var myArray = new Array('Anil','Singh','Kushinagar');
 alert(myArray.join('>>'));
}
</script>

HTML Code:
<button id=”btnjoin”  onclick="joinfun()">Join Arry Sting</button>
 
isNAN() Method in JavaScript
The isNaN() function determines whether a value is an illegal number (not-a-number). This function returns true if the value is NaN, and false if not.

Syntax: isNaN('12.30');


JavaScript Code:
<script language="javascript">
function funisNaN()
{
              alert(isNaN('12.30'));
}
</script>

HtML Code:
<button id=”btn_isNaN” onclick="funisNaN()">isNaN</button>

No comments: