I want the 2.4.6 indexes that refer to Asian countries to be stored in their respective array, and the rest in the other array
mix = ['nulla' , 'italia', 'cina', 'germany', 'india', 'france', 'japan']
europa = []
asia = []
with the following operation I receive only an undefined error
mix.map(function(indice){ if(indice % 2 == 0) {asia.push(indice)}}) // undefined
with my previous code I did not have any problem
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
numbers.map(function(x){if(x % 2 == 0) {pares.push(x)}})
/*
undefined
[2, 4, 6, 8, 10] ] */
numbers.map(function(x){if(x % 2 == 1) {dispares.push(x)}}) // undefined [1, 3, 5, 7, 9]
although I did not understand why I returned undefined