# 如何判断JS对象中是否存在某个值

Object.values(对象名).indexOf(待检测值)，若返回-1表示不包含对应值；返回值不等于-1则表示包含。

```screen
var res = array.indexOf(val)
```

