Javascript Array With Method In Javascript