// Create an object that has no prototype. This will prevent any default keys from // existing in the object. This means that ANY and ALL keys in this object must be // user-provided, which makes it very useful for a cache container. var safeCache = Object.create( null ); // Let's check to see if any common Object keys exist in this object. [ "hasOwnProperty", "toString", "valueOf", "constructor", "__proto__" ] .forEach( function iterator( key, index ) { console.log( "[ %s ] exists: %s", key, ( key in safeCache ) ); } ) ;