how to get a new list from an array in javascript code example Example: javascript declare array var array = []