This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function iterate (obj, key) { | |
| var result; | |
| for (var property in obj) { | |
| if (obj.hasOwnProperty(property)) { | |
| // in case it is an object | |
| if (property.match(RegExp(key, 'gi'))) { | |
| return obj[property]; // returns the value | |
| } else if (typeof obj[property] === "object") { | |
| result = iterate(obj[property], key); | |
| if (typeof result !== "undefined") { |