Completed exercise on math functions in javascript