1.0.3 • Published 10 years ago
compare-json-keys v1.0.3
Compare JSON keys
This module compares keys (not values) of two JSON objects. It returns true
if keys are the same, otherwise false
.
Install
npm install --save compare-json-keys
Usage
var compareJsonKeys = require('compare-json-keys');
var obj1 = { a: 1, b: 2 };
var obj2 = { b: 1, a: 2 };
console.log(compareJsonKeys(obj1, obj2));
And the output is:
true
License
MIT © Samir Djellil