Why does numeric sort look wrong here?

Consider this snippet.

console.log([10, 2, 5].sort());

Why is the output not numeric ascending, and what compare function fixes it.

WaffleFries

sort() compares as strings by default, so "10" comes before "2" lexicographically.

Sarah