This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function validateEmail() { | |
// Validate email here and show error message if not valid | |
} | |
var emailInput = document.getElementById("email-field"); | |
emailInput.addEventListener("keyup", _.debounce(validateEmail, 500)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getRandomInteger() { | |
return Math.round(Math.random() * 100); | |
} | |
var result = _.times(5, getRandomNumber); | |
// result => [64, 70, 29, 10, 23] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' } |
NewerOlder