javascript
Published on January 26, 2024By DeveloperBreeze
// Original array and sorting
let arr = [5, 2, 8, 1, 4];
console.log('Original Array:', arr);
// Sorting the array using the sort method
arr.sort();
console.log('Sorted Array:', arr);
// Original array and sorting
let arr = [5, 2, 8, 1, 4];
console.log('Original Array:', arr);
// Sorting the array using the sort method
arr.sort();
console.log('Sorted Array:', arr);
Comments
Please log in to leave a comment.