Multiple choice technology programming languages

The correct way to find index of an array element.days = [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ] is days.index(“Saturday”).

  1. True

  2. False

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In Ruby, the index method (also called find_index) returns the position of the first occurrence of the specified element in the array. For days.index("Saturday"), this would return 5 (zero-indexed) or 6 (one-indexed position), which is the correct way to find an element's index.