i need program in which you enter words via the keyboard or file and then they come out sorted by length using javascript
![]() ![]() ![]() |
|||||
|
![]() ![]() |
You should take a look at the array sort method. You can use it and pass in a function that performs the sorting based on whatever criteria you like. |
||
|
![]() ![]() |
Here's an example on how to Sort an Array in Javascript |
||
|
![]() ![]() |
The sort method takes a function as a parameter:
|
||
|