UNPKG

@ahsolo/lotide

Version:

lotide assignment for Lighthouse Labs coding bootcamp

23 lines (19 loc) 583 B
const findKey = require("../findKey"); // Test Function const assertEqual = function(actual, expected) { if (actual === expected) { console.log(`✅ Assertion Passed: ${actual} === ${expected}`); } else { console.log(`❌ Assertion Failed: ${actual} !== ${expected}`); } }; assertEqual(findKey({ "Blue Hill": { stars: 1 }, "Akaleri": { stars: 3 }, "noma": { stars: 2 }, "elBulli": { stars: 3 }, "Ora": { stars: 2 }, "Akelarre": { stars: 3 } }, x => x.stars === 2), "noma"); assertEqual(findKey({a:1, b:2, c:3}, x => x % 2 === 0), "b");