You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Write a function sortYears() that takes in an array of years, and, using the built-in .sort() method, returns that array with the years sorted in descending order.
const sortYears = arr => arr.sort((a, b) => {
// console.log('b',arr.indexOf(b),b)
// console.log('a',arr.indexOf(a),a)
return b - a;
});
// Feel free to uncomment the below code to test your function: