new Set()
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
let arr=['123','345','456']
let a=new Set(arr)
console.log(a.has('123'));//true
console.log(a.has('3'));//false
console.log(arr.indexOf('123'));//索引
console.log(arr.indexOf('3'));//-1
</script>
</body>
</html>