Você pode atribuir variáveis a partir de arrays desta forma:
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]Crie as variáveis first, second, third e other a partir do array fornecido usando a atribuição por desestruturação (consulte a aba Recursos para ver alguns exemplos).
first ➞ 1
second ➞ 2
third ➞ 3
other ➞ [4, 5, 6, 7, 8]Sua tarefa é desempacotar o array writeyourcodehere em quatro variáveis: first, second, third e other.