What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-21 15:12:16
JavaScript does not protect the property name hasOwnProperty
// hasOwnProperty – JavaScript does not protect var foo = { // overriding foo's default hasOwnProperty method hasOwnProperty: function() { return false; }, bar: 'data' }; foo.hasOwnProperty('bar'); // false always // Hence, ... Add solution -
Javascript 2021-10-16 18:59:13
hasownproperty.call
var foo = { hasOwnProperty: function() { return false; }, bar: 'Here be dragons' }; foo.hasOwnProperty('bar'); // always returns false // Use another Object's hasOwnProperty // and call it with 'this' set to foo ({}).hasOwnProperty.call(foo, '... Add solution -
Other 2021-09-11 03:01:02
class="lazy"
/* lazyload.js (c) Lorenzo Giuliani * MIT License (http://www.opensource.org/licenses/mit-license.html) * * expects a list of: * `<img src="blank.gif" data-src="my_image.png" width="600" height="400" class=... Add solution