🔸나의 풀이
let num_list = [1, 2, 3, 4, 5];
let answer = []
answer[0] = num_list.filter(n => n % 2 === 0).length;
answer[1] = num_list.filter(n => n % 2 !== 0).length;
console.log(answer)
🔸다른 풀이
function solution(num_list) {
var answer = [0,0];
for(let a of num_list){
answer[a%2] += 1
}
return answer;
}