-3

Possible Duplicate:
JavaScript: min & max Array values?
Generate max 'N' values from javascript array

var arr = new Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)

How to execute 5 max values from this array? result must be like 10, 9, 8, 7, 6

Community
  • 1
  • 1
my13
  • 11
  • 2

2 Answers2

0

Check out the Arrays Java API doc. It'll give you some practice in reading up on documentation as well as give you methods to use to solve the homework problem ;)

CJ McAllister
  • 291
  • 3
  • 10
  • 20
0

you can try this 1. first you arrange Array in ascending order. 2. get it's Length. 3. get last 5 Digits whose u have required.

i thinks this is helpful to you. ..! cheers

MRT
  • 1,610
  • 15
  • 41