SHARE
TWEET

Untitled

a guest Dec 3rd, 2019 72 in 1 day
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function showProps(obj, objName) {
  2.   var result = ``;
  3.   for (var i in obj) {
  4.     // obj.hasOwnProperty() is used to filter out properties from the object's prototype chain
  5.     if (obj.hasOwnProperty(i)) {
  6.       result += `${objName}.${i} = ${obj[i]}\n`;
  7.     }
  8.   }
  9.   return result;
  10. }
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