take function:

  • Can also be called as take_first

Take the first N of element in an array, object of string

Examples:

  • running: (take [1, 2, 3, 4], 2) will give: [1, 2]

  • running: (take [1, 2, 3, 4], 6) will give: [1, 2, 3, 4]

  • running: (take {"key-1": 1, "key-2": false}, 1) will give: {"key-1": 1}

  • running: (take {"key-1": 1, "key-2": false}, 3) will give: {"key-1": 1, "key-2": false}

  • running: (take "123", 2) will give: "12"

  • running: (take "123", 20) will give: "123"

  • running: (take 50, 10) will return nothing

  • running: (take "123", false) will return nothing