Check out example codes for "ruby silce!". It will help you in understanding the concepts better.

Code Example 1

a = [ "a", "b", "c" ]
a.slice!(1)     #=> "b"
a               #=> ["a", "c"]
a.slice!(-1)    #=> "c"
a               #=> ["a"]
a.slice!(100)   #=> nil
a               #=> ["a"]

Learn ReactJs, React Native from akashmittal.com