writing a function for arrays javascript code example Example 1: javascript declare array var array = [] Example 2: make list in javascript var scores = Array(10);