Sort array

PHOTO EMBED

Fri Apr 02 2021 08:01:12 GMT+0000 (UTC)

Saved by @thepuskar #javascript #array #sort

const arr = [333,1,2,11,22,3,4]
console.log(arr.sort())

arr.sort((a,b)=>a-b)

console.log(arr)
content_copyCOPY