Ruby - Arrays
What will be the output of the following Ruby code?
arr = [1, 2, 3] arr.push(4) arr.shift p arr
arr = [1, 2, 3] arr.push(4) arr.shift p arr
push(4) on arrayshift to remove first element15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions