{ Javascript snippets }

Minko Gechev

Minko Gechev @mgechev

JavaScript tip: did you know you can listen for a *single occurrence* of an event using addEventListener? You can specify a configuration object as a third parameter. https://t.co/R0JwOMueVi

Umar Hansa

Umar Hansa @umaar

Little JavaScript snippet to see what all those .toThing() methods do on a Date object: Object.getOwnPropertyNames(Date.prototype) .filter(name => name.startsWith('to')) .map(method => `${method}: ${(new Date())[method]()}`) https://t.co/3H8XcZbgja

Wes Bos

Wes Bos @wesbos

🔥Default function arguments can fallback to a function. This won't be run at definition time, but only once the function is called and no argument is provided. In this case, Math.random() returns a new random number each time https://t.co/xtrn822CEN