Skip to content

containsValue

containsValue(object, value) → boolean · Object

Check if an object contains a specific value (searches all values).

  • object (required): object to search

  • value (required): value to find

utlx
let config = {host: "localhost", port: 5432, db: "mydb"}
{
  hasLocalhost: containsValue(config, "localhost"),   // true
  hasRedis: containsValue(config, "redis")           // false
}

Released under AGPL-3.0.