Guest User

Untitled

a guest
Jul 18th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. javascript: (function () {
  2.  
  3. var uniqueProps = {};
  4. allKeys.forEach(function (prop) {
  5. uniqueProps[prop] = [];
  6. for (var key in cqObject) {
  7. var cqRow = cqObject[key];
  8. var cqRowsThisPropValue = cqRow[prop];
  9. if (!(uniqueProps[prop].includes(cqRowsThisPropValue))) {
  10. uniqueProps[prop].push(cqRowsThisPropValue);
  11. }
  12. }
  13. });
  14. var msg = '';
  15. var counter = 0;
  16. for (var key in uniqueProps) {
  17. if (uniqueProps[key].length == 1) {
  18. msg += key + ' : ' + uniqueProps[key] + '\n';
  19. removeClass(key);
  20. counter++;
  21. }
  22. }
  23. if (counter) {
  24. var mesg = 'These ' + counter + ' properties are same for all ' + Object.keys(cqObject).length + ' objects compared :\n\n' + msg;
  25. alert(mesg);
  26. }
  27.  
  28. })();
Add Comment
Please, Sign In to add comment