Ruby - Arrays
Why does
arr.pop return the removed element, but arr.push(5) returns the array itself?arr.pop return the removed element, but arr.push(5) returns the array itself?pop removes and returns the last element removed from the array.push adds element(s) and returns the updated array to allow method chaining.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions