0% found this document useful (0 votes)
5 views

3th Css

Uploaded by

Ganesh Ekambe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

3th Css

Uploaded by

Ganesh Ekambe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Client side Scripting Language (22519)

Name of Student: Ekambe Ganesh Roll No.: 53


Practical No. 03

Practical No-3.Develop JavaScript to implements Array


functionalities

<html>
<head>
<script type="text/javascript">
var Village = new Array("Udgir", "Nanded", "Pune", "Jalkot");
Array.prototype.displayItems=function(){
for (i=0;i<this.length;i++){
document.write(this[i] + "<br />");
}
}
document.write(" Village array<br />");
Village.displayItems();
document.write("<br />The REVERSED village array<br />");
Village.reverse();
Village.displayItems();
document.write("<br />The number of items in village array is " +
Village.length + "<br />");
document.write("<br />The SORTED village array<br />");
Village.sort();
Village.displayItems();
document.write("<br />The village array after REMOVING the LAST item<br
/>");
Village.pop();
Village.displayItems();
document.write("<br />THE village array after PUSH<br />");
Village.push("Delhi");
Village.displayItems();
document.write("<br />The village array after SHIFT<br />"); Village.shift();
Village.displayItems();
</script>
</head>
<body>
</body>
</html>
Client side Scripting Language (22519)

Name of Student: Ekambe Ganesh Roll No.: 53


Practical No. 03

Output

Output
Client side Scripting Language (22519)

Name of Student: Ekambe Ganesh Roll No.: 53


Practical No. 03

2. simple array program

<html>
<script type ="text/javascript">
arr1 = new Array(3)
arr1[0] = 10
arr1[1] = 20
arr1[2] = 30
document.write("Array 1: ", arr1 + "<br>" )

arr2 = new Array(10, 20, 30, 40, 50);


document.write("Array 2: ", arr2 + "<br>")

arr3 = new Array(5);


document.write("Array 3: ", arr3+ "<br>")

arr4 = new Array("Ganesh");


document.write("Array 4: ", arr4+ "<br>")
</script>
</html>

Output
Client side Scripting Language (22519)

Name of Student: Ekambe Ganesh Roll No.: 53


Practical No. 03

3. Intialization Of an array

<!DOCTYPE html>
<html>
<head>
<title>Initializing Array</title>
</head>
<body>
<h1>Initializing Array</h1>
<p>This program initializes and displays an array.</p>

<script>
// Initialize an array
var numbers = [1, 2, 3, 4, 5];

// Display the array


document.write("<p>Numbers: " + numbers.join(', ') + "</p>");
</script>
</body>
</html>

Output

You might also like