Sql Declare Array Variable Javascript Array Functions