latest Post

Array Functions in Javascript

<html>
<head>
<title>Array Object</title>
<script language="javascript" type="text/javascript">
document.write("<h1 align='center'><font color='orange'>Array Functions</font></h1><hr/>");

var arr = new Array(45634,"ram","ram@gmail.com","california");

document.write("<h2>Length of an array</h2>");
document.write(arr.length);

document.write("<h2>Sort array values</h2>");
document.write(arr.sort());

document.write("<h2>Insert values in an array</h2>");
var data = new Array();
data.push("html","css","javascript","php","java","css","c","html","c++","c");
document.write(data);

document.write("<h2>Delete value from an array</h2>");
data.pop();
data.pop();
document.write(data);

document.write("<h2>Concat arrays</h2>");
var res = data.concat(arr);
document.write(res);

document.write("<h2>Join array values</h2>");
document.write(res.join("-"));
</script>
</head>
<body>
</body>
</html>

About Mallikarjun A

Mallikarjun A
Recommended Posts × +

0 comments:

Post a Comment