Ruby - Arrays
Given
arr = [3, 4], which code snippet results in [1, 2, 3, 4, 5]?arr = [3, 4], which code snippet results in [1, 2, 3, 4, 5]?arr.unshift(1, 2) adds 1 and 2 at front, array becomes [1, 2, 3, 4].arr.push(5) adds 5 at end, array becomes [1, 2, 3, 4, 5].15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions