Draft
Simplified object comparison
129 of 130Katbow
Description:
This is a simplified version of Deep comparison of objects.
It's not easy to compare objects in JavaScript. Even two objects with the same properties and values will be considered different.
{a: 1, b: 2} === {a: 1, b: 2}
// false
Your task is to create a function, compareObjects(objectA, objectB)
, which compares 2 objects. The parameters will always be objects, and will not contain other objects or arrays, just strings and numbers. It will return true
if the objects are the same, and false
if they are not.
If both objects have the same values in a different order, they are considered the same. e.g.
compareObjects({a: "bc", d: "ef"}, {d: "ef", a: "bc"})
// true
NB: The JSON.stringify
method is invalid.
Fundamentals
Similar Kata:
Stats:
Created | Nov 30, 2015 |
Warriors Trained | 292 |
Total Skips | 50 |
Total Code Submissions | 874 |
Total Times Completed | 130 |
JavaScript Completions | 129 |
CoffeeScript Completions | 6 |
Total Stars | 7 |
% of votes with a positive feedback rating | 80% of 72 |
Total "Very Satisfied" Votes | 51 |
Total "Somewhat Satisfied" Votes | 13 |
Total "Not Satisfied" Votes | 8 |
Total Rank Assessments | 63 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |