DEV Community

Discussion on: JavaScript Array methods

Collapse
 
shreyazz profile image
Shreyas Pahune

That is how the sort function is made...you just have to give it a variable, and if the values matches then it will get pushed into the new variable we created.