С учетом
commentIdList = [2,3]
comments = { 1 : "a", 2: "b", 3: "c", 4: "d" }
Требуется вывод
filteredComments = [ {2:"b"} , {3:"c"} ]
Моя неудачная попытка
const filteredComments = comments.filter((c)=> commentsIdList.map(comment=>c.id === comment))