How to sort array in ascending order in JavaScript

Arrays
Last updated Dec 23, 2017
const numbers = [10, 20, 30, 100, 5, 1, 20];

numbers.sort((a, b) => a - b);

console.log(numbers);
[1, 5, 10, 20, 20, 30, 100]