Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save banhaclong20/13b3d8eb8f81fdd48e7336069e0a4ba2 to your computer and use it in GitHub Desktop.
Save banhaclong20/13b3d8eb8f81fdd48e7336069e0a4ba2 to your computer and use it in GitHub Desktop.
Loop object
// Object.keys(searchkit).map(key =>
// console.log(searchkit[key])
// )
// for (var key in searchkit) {
// // skip loop if the property is from prototype
// if (!searchkit.hasOwnProperty(key)) continue;
// var obj = searchkit[key];
// for (var prop in obj) {
// // skip loop if the property is from prototype
// if(!obj.hasOwnProperty(prop)) continue;
// // your code
// console.log(obj[prop][2]);
// }
// }
Object.keys(searchkit).forEach(function(key) {
console.log(key, searchkit[key]);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment