@nknahom/lotide
Version:
Lotide is mini clone of the Lodash (https://lodash.com) library for learning JavaScript. What is Lodash? Lodash is a library that makes JavaScript easier by taking the hassle out of working with arrays, numbers, objects, strings, etc.
22 lines (18 loc) • 623 B
JavaScript
// Returns true if both objects have identical keys with identical values.
// Otherwise you get back a big fat false!
const eqObjects = require("./eqObjects");
// FUNCTION IMPLEMENTATION
const assertObjectsEqual = function (actual, expected) {
// Implement me!
const inspect = require("util").inspect; // <= add this line
if (eqObjects(actual, expected)) {
console.log(
`\u2705 Assertion Passed: ${inspect(actual)} === ${inspect(expected)}`
);
} else {
console.log(
`\u26D4 Assertion Failed: ${inspect(actual)} !== ${inspect(expected)}`
);
}
};
module.exports = assertObjectsEqual;