What do you want to save?
Add Code snippet
New code examples
-
Other 2021-09-28 08:57:02
how to init npm
The npm init command is a step-by-step tool to scaffold out your project. It will prompt you for input for a few aspects of the project in the following order: The project's name, The project's initial version, The project's description, The project's ... Add solution -
Other 2021-09-28 05:26:02
11.4. Receiving Function Arguments
/*The logError function outputs a standardized error message to a location determined by the parameter logger.*/ let fileLogger = function(msg) { // Put the message in a file } function logError(msg, logger) { let errorMsg = 'ERROR: ' + msg; ... Add solution -
Javascript 2021-09-28 04:52:05
figure out if a linked list contains a cycle javascript
function LinkedListNode(value) { this.value = value; this.next = null; } let head = new LinkedListNode(10) head.next = new LinkedListNode(25) head.next.next = new LinkedListNode(46) function hasCycle(head) { let node = head; let map={}; while(n... Add solution -
Javascript 2021-09-27 22:26:03
chrome block javascript alert
// ==UserScript== // @name Wordswithfriends, Block javascript alerts // @match http://wordswithfriends.net/* // @run-at document-start // ==/UserScript== addJS_Node (null, null, overrideSelectNativeJS_Functions); function overrideSelec... Add solution -
Javascript 2021-09-27 10:56:02
Adding an event listener to an element that doesn't exist yet
// You need to add the event listener when the element is created. function createEventListener() { var node = document.createElement('div'); if (node) { node.addEventListener('click', function() { console.log('Clicked Node'); ... Add solution -
Other 2021-09-27 09:36:04
JSON Schema Verify/AJV
// or ESM/TypeScript import import Ajv from "ajv" // Node.js require: const Ajv = require("ajv") const ajv = new Ajv() // options can be passed, e.g. {allErrors: true} const schema = { type: "object", properties: { ... Add solution