Skip to content

Instantly share code, notes, and snippets.

View orvigas's full-sized avatar
🎯
Focusing

Orlando Villegas Galán orvigas

🎯
Focusing
View GitHub Profile
@orvigas
orvigas / hasKey.js
Last active April 29, 2018 15:33
Function to look for a key inside a complex object in Javascript
/**
* This function allows to search a especific key in a complex object
* @author orvigas@gmail.com
* @param (Object) o: Object in which you look for the key
* @param (string) key: Name of key you're looking for
* @return (mixed) $r: Return object or value related with key name,
* instead if key were not found it return undefined
*/
function hasKey(o, key) {