SHARE
TWEET

Untitled

a guest Jun 25th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Implementação Dr. Axel
  2. function findKeyAxel(object, callback, thisValue) {
  3.   for (const [key, value] of Object.entries(object)) {
  4.     if (callback.call(thisValue, value, key, object)) {
  5.       return key;
  6.     }
  7.   }
  8.   return undefined;
  9. }
  10.  
  11. //Minha implementação
  12. function findKey(obj, callback){
  13.     const key = Object.entries(obj).find(callback)[0];
  14.     return ( key !== undefined ? key:undefined );
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top