Get Range Of Array Javascript Function How To Use