Puedes asignar variables a partir de arreglos de esta manera:
arr = [1, 2, 3, 4, 5, 6, 7, 8]
first = arr[0]
second = arr[1]
third = arr[2]
other = arr[3...arr.length]
puts(first) ➞ outputs 1
puts(second) ➞ outputs 2
puts(third) ➞ outputs 3
puts(other) ➞ outputs [4, 5, 6, 7, 8]Crea las variables first, second, third y other a partir del arreglo proporcionado usando la asignación por desestructuración (consulta la pestaña Recursos para ver algunos ejemplos).
first ➞ 1
second ➞ 2
third ➞ 3
other ➞ [4, 5, 6, 7, 8]Tu tarea es desempaquetar el arreglo writeyourcodehere en cuatro variables: first, second, third y other.