ぶんかつすうじれつ



質問リンク


https://programmers.co.kr/learn/courses/30/lessons/12910?language=javascript

Javascript

function solution(arr, divisor) {
  var answer = arr.filter(v => v%divisor == 0);
  return answer.length == 0 ? [-1] : answer.sort((a,b) => a-b);
}