Returns true if the given value is part of the given object, otherwise it returns false.
Note: this doesn't work with non-primitive values. For example, includesValue({x: {}}, {}) returns false.
includesValue({x: {}}, {})
The type of the values in the input record.
The record to check for the given value.
The value to check for in the record.
true if the value is part of the record, otherwise false.
true
false
import { includesValue } from "@std/collections/includes-value";import { assertEquals } from "@std/assert";const input = { first: 33, second: 34,};assertEquals(includesValue(input, 34), true); Copy
import { includesValue } from "@std/collections/includes-value";import { assertEquals } from "@std/assert";const input = { first: 33, second: 34,};assertEquals(includesValue(input, 34), true);
Returns true if the given value is part of the given object, otherwise it returns false.
Note: this doesn't work with non-primitive values. For example,
includesValue({x: {}}, {})returns false.