today I was writing some code and I realized I cannot do
x.push(5, 9).sort(); //wrong
nor can I do
x.sort(x.push(5, 9)); //wrong
and had to do
x.push(5, 9);
x.sort();
I was wondering isn't there a way to make it one line?> also, what's the difference between the two lines below
x.sort((a, b) => a - b);
x.sort();