Skip to content

Latest commit

 

History

History
27 lines (17 loc) · 502 Bytes

to_array.md

File metadata and controls

27 lines (17 loc) · 502 Bytes

to-array, to-object

Turns the argument into an array or an object.

to-array [ 0 1 2 ]
  # --> [ 0 1 2 ]  # (left intact)

to-array 123
  # --> [ 123 ]

to-array { a: 'A', b: 'B' }
  # --> [ [ 'a', 'A' ], [ 'b', 'B' ] ]

and

to-object [ 'a' 'A' 'b' 'B' 'c' 'C' ]
  # --> { 'a': 'A', b: 'B', c: 'C' }