Skip to content

Latest commit

 

History

History
12 lines (8 loc) · 295 Bytes

File metadata and controls

12 lines (8 loc) · 295 Bytes

Exercise 2 - contains

Write a function that searches for a value in a nested object. It returns true if the object contains that value.

Objects are compared by reference.

Examples:

contains({ foo: "foo" }, "bar") // false
contains({ foo: { bar: "bar" } }, "bar") // true