using javascript array