Home / Javascript Tips Generated By ChatGPT / Using Array sort Method in Javascript Sort elements of an array. Source Code let numbers = [3, 1, 4, 1, 5, 9]; numbers.sort(); console.log(numbers); // [1, 1, 3, 4, 5, 9]