Javascript Array Foreach Function Example Problems Trigonometric Functions