make javascript return a list type