Final
This commit is contained in:
RobinNixon
2020-12-10 13:50:02 +00:00
parent ec6f6b8d61
commit 3aeeb4477e
847 changed files with 0 additions and 0 deletions
-21
View File
@@ -1,21 +0,0 @@
<script>
// Alphabetical sort
sports = ["Football", "Tennis", "Baseball", "Hockey"]
sports.sort()
document.write(sports + "<br>")
// Reverse alphabetical sort
sports = ["Football", "Tennis", "Baseball", "Hockey"]
sports.sort().reverse()
document.write(sports + "<br>")
// Ascending numeric sort
numbers = [7, 23, 6, 74]
numbers.sort(function(a,b){return a - b})
document.write(numbers + "<br>")
// Descending numeric sort
numbers = [7, 23, 6, 74]
numbers.sort(function(a,b){return b - a})
document.write(numbers + "<br>")
</script>