push / << / popAdds / removes elements.Syntaxarr << element · arr.push(e)Description<< and push add to the end; pop removes and returns the last element.ExampleLoading editor…▶ Try it yourselfExpected output[1, 2, 3] 3When to use?Growing lists, stack.Related commandsarr [ ]include? / index← arr [ ]include? / index →