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-19 08:43:10
inheritance in javascript
function Animal (name, energy) { this.name = name this.energy = energy } Animal.prototype.eat = function (amount) { console.log(`${this.name} is eating.`) this.energy += amount } Animal.prototype.sleep = function (length) { console.log(`${this... Add solution -
Javascript 2021-10-18 23:59:04
node.js untrusted_authority: The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter."
const fetch = require('node-fetch-with-proxy'); async function sendGetRequestAsync(url, options) { const response = await fetch(url, options); const json = await response.json(); const headers = response.headers.raw(); return { headers: Objec... Add solution -
Html 2021-10-16 22:57:04
input date default value html
<!-- HTML --> <input type="date" id="theDate"> <script> // JQuery $(document).ready( function() { $('#theDate').val(new Date().toDateInputValue()); }); // Pure JS document.getElementById('theDate').v... 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 -
Javascript 2021-10-16 10:20:08
merge array of objects javascript
var arr1 = [{name: "lang", value: "English"},{name: "age", value: "18"}]; var arr2 = [{name : "childs", value: '5'}, {name: "lang", value: "German"}]; Array.prototype.push.apply(arr1,a... Add solution
Best helpers
Shaples
+5
Tranquilled
+5
Kozuch
+5
Big D Rock
+5
The 313137
+5
Toby Stewart
+5
Moez
+5
Stelle
+5
Kathrin
+5
Moradnejad
+5
Tony_Henrich
+5