javascript array functions interview questions