Creating new additional methods for array in js