As already stated by @Bergi, you're fine to do that, because there's no such function in Lo-Dash.
As a suggestion, you could test if N objects share that keys, and not only 2!
Question
I have two objects A and B. I want to know if they share the keys x and y.
I wrote this:
function sharesKeys(keys, objA, objB) {
return _.every(keys, function (key) {
return key in objA && key in objB;
});
}
to be called as:
if (sharesKeys(['x', 'y'], cellA, cellB)) { ...
but want to know if I am missing a lo-dash method to do this directly.
Solution
As already stated by @Bergi, you're fine to do that, because there's no such function in Lo-Dash.
As a suggestion, you could test if N objects share that keys, and not only 2!