I want to add an item just before the end:
rb(main):003:0> a = [1,2,3]
[1, 2, 3]
irb(main):004:0> last=a.pop; a.push “second last”; a.push last
[1, 2, “second last”, 3]
Is there a better way than this “pop,push,push” thing? I looked for an
Array.insert, but can’t find anything like it.
Sam