Step: Array/String Slice: .[10:15]

Array/String Slice: .[10:15]

Similar to many programming languages you can select a range from array with a syntax .[10:15] where first number is start index, and second is end index.

Omitted index indicates beginning or end of the array: .[:15] - from beginning till 15th, .[10:] - from 10th till the end.

Now let's see if you can select 2 hobbies out of the previous example.

Input:
{
  "firstName": "Charles",
  "lastName": "Doe",
  "hobbies": [
    "chess",
    "netflix",
    "fitness"
  ]
}
Expected:
[
  "netflix",
  "fitness"
]