Which built-in method sorts the elements of an array?



Which built-in method sorts the elements of an array?..

Answer / Pappu Chauhan

The sort() method in JavaScript is a built-in method that sorts the elements of an array. It takes an optional compare function as an argument to customize the sorting order. If no compare function is provided, it sorts the array using its default string comparison algorithm.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JavaScript Interview Questions

Explain typecasting in javascript?

1 Answers  


Write a Program of Simple Calculator in JavaScript using HTML.

1 Answers  


How to add buttons in javascript?

1 Answers  


What is the data type of variables of in javascript?

1 Answers  


What are data structures in javascript?

1 Answers  


Is javascript multi-threaded or single-threaded?

1 Answers  


What is the statement to enable strict mode in javascript quiz?

1 Answers  


How can we detect os of the client machine using javascript?

1 Answers  


How to get value of an element by class in javascript ?

1 Answers  


why is java platform indipedence

2 Answers   HCL,


Write the point of difference between web-garden and a web-farm?

1 Answers  


How do you check if a value is a number in javascript?

1 Answers  


Categories