Ruby - Arrays
What does the expression
arr[1..3] do when arr = [10, 20, 30, 40, 50]?arr[1..3] do when arr = [10, 20, 30, 40, 50]?1..3 includes both 1 and 3, so it covers indexes 1, 2, and 3.arr[1..3] returns elements at indexes 1, 2, and 3, which are 20, 30, and 40.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions