0% found this document useful (0 votes)
15 views4 pages

Practical 3

css manual code / output
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views4 pages

Practical 3

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

1.

Code

<html>
<head><title>4. Atharva Wadekar</title> </head>
<body>
<script language="javascript" type="text/javascript">

let array = [4,3,2,1,11,12,15,14];


document.write("Original Array: " + array + "<br>");
array.sort(function(a,b){return a-b;});
document.write("Sorted Array: " + array);

</script>
</body>
</html>

Output
2. Code

<html>
<head><title>4. Atharva Wadekar</title> </head>
<body>
<script language="javascript" type="text/javascript">

let array = [4,3,2,2,2,1,11,12,2,15,14];


let UniqueArray = Array.from(new Set(array));

document.write("Original Array: " + array + "<br>");


document.write("Unique Array: " + UniqueArray);

</script>
</body>
</html>

Output
3. Code

<html>
<head><title>4. Atharva Wadekar</title> </head>
<body>
<script language="javascript" type="text/javascript">

let array = [4,3,2,1,13,11,5,15,14];


document.write("Original Array: " + array + "<br><br>");

array.sort(function(a,b){return a-b});
document.write("Ascending Array: " + array + "<br><br>");

let DscArray = array.sort(function(a,b){return b-a});


document.write("Descending Array: " + array);

</script>
</body>
</html>
Output

You might also like