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
// It's a kind of magic JavaScript (part 1) | |
['10', '10', '10'].map(parseInt); // [ 10, NaN, 2 ] | |
['10', '10', '10'].map(Number); // [ 10, 10, 10 ] |
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 getRandomName () { | |
var minNameLength = 5, | |
maxNameLength = 11; | |
var vowels = 'aeiouy', | |
consonants = 'bcdfghjklmnpqrstvwxyz', | |
probability = {vowel: 4, consonant: 6}, | |
totalProbabitily = probability.vowel + probability.consonant; | |
var nameLength = minNameLength + Math.floor(Math.random() * (maxNameLength - minNameLength + 1)); |
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 GetQuadraticFunction (a, b, c, d) { | |
return (function (a, b, c, d) { | |
function init (value, defaultValue) { | |
value = parseFloat(value); | |
if (Number.isNaN(value) || !Number.isFinite(value)) { | |
value = defaultValue; | |
} | |
NewerOlder