Skip to content

Instantly share code, notes, and snippets.

@Quemia
Created April 6, 2020 05:59
Show Gist options
  • Select an option

  • Save Quemia/c77bbce1435f1ca71b38ac23d3e74516 to your computer and use it in GitHub Desktop.

Select an option

Save Quemia/c77bbce1435f1ca71b38ac23d3e74516 to your computer and use it in GitHub Desktop.

Take

returns the first n element of an array/enumeration.

Ex:

a = [1,2,3,4,5,0]
a.take(3) => [1,2,3]
a.take(30) => [1,2,3,4,5,0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment