我需要一些帮助来获取具有重复值的对象键. 我所拥有的是Object namenumn中的大约numn00个键(这是示例)
numn={
"28": "The invincible special forces who returned to the Three Kingdoms(回到三国的无敌特种兵)",
"46": "Three Kingdoms: The opening incorporates Li Cunxiao(三国:开局融合了李存孝)",
"62": "Douluo: Super Beast Armed Guard Zhu Zhuqing(斗罗:超兽武装守护朱竹清)",
"76": "The Oriental Cavalry that swept across the Three Kingdoms(横扫三国的东方铁骑)",
"1514": "The Rise of an Empire(帝国崛起)",
"3140": "A leisurely life in another world(异界的悠闲生活)",
"5117": "The rise of an empire(帝国崛起)",
"5127": "After eavesdropping on my voice, the whole family went crazy(偷听我心声后,全家都杀疯了)",
"5148": "The Rise of an Empire(帝国崛起)",
"8440": "A ghost calls at the door in the middle of the night(夜半鬼叫门)",
"13140": "A leisurely life in another world(异界的悠闲生活)",
"13154": "The time travel story of Iron Ambition Man(钢铁雄心之舰男穿越记)",
}
我想要的是用它的键获得所有重复值,如下所示
numn={
"1514": "The Rise of an Empire(帝国崛起)",
"5117": "The rise of an empire(帝国崛起)",
"5148": "The Rise of an Empire(帝国崛起)",
"3140": "A leisurely life in another world(异界的悠闲生活)",
"13140": "A leisurely life in another world(异界的悠闲生活)",
}
我试过这个
let findDuplicates = arr => arr.filter((item, index) => arr.indexOf(item) !== index)
Duplicates=findDuplicates(Object.values(numn))
但它只有在没有键的情况下才会获得重复值
Duplicates=[
'The Rise of an Empire(帝国崛起)',
'A leisurely life in another world(异界的悠闲生活)'
]
请帮帮我, 抱歉我的英文写得不好