Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- javascript: (function () {
- var uniqueProps = {};
- allKeys.forEach(function (prop) {
- uniqueProps[prop] = [];
- for (var key in cqObject) {
- var cqRow = cqObject[key];
- var cqRowsThisPropValue = cqRow[prop];
- if (!(uniqueProps[prop].includes(cqRowsThisPropValue))) {
- uniqueProps[prop].push(cqRowsThisPropValue);
- }
- }
- });
- var msg = '';
- var counter = 0;
- for (var key in uniqueProps) {
- if (uniqueProps[key].length == 1) {
- msg += key + ' : ' + uniqueProps[key] + '\n';
- removeClass(key);
- counter++;
- }
- }
- if (counter) {
- var mesg = 'These ' + counter + ' properties are same for all ' + Object.keys(cqObject).length + ' objects compared :\n\n' + msg;
- alert(mesg);
- }
- })();
Add Comment
Please, Sign In to add comment