Skip to content

Instantly share code, notes, and snippets.

View VincentDamour's full-sized avatar

Vincent D'amour VincentDamour

View GitHub Profile
function validateEmail() {
// Validate email here and show error message if not valid
}
var emailInput = document.getElementById("email-field");
emailInput.addEventListener("keyup", _.debounce(validateEmail, 500));
function getRandomInteger() {
return Math.round(Math.random() * 100);
}
var result = _.times(5, getRandomNumber);
// result => [64, 70, 29, 10, 23]
var foo = { a: "a property" };
var bar = { b: 4, c: "an other property" }
var result = _.assign({ a: "an old property" }, foo, bar);
// result => { a: 'a property', b: 4, c: 'an other property' }