Skip to content

Instantly share code, notes, and snippets.

View bozheville's full-sized avatar

Denys Grybov bozheville

View GitHub Profile
@bozheville
bozheville / name-generator.js
Created June 22, 2018 10:10
random name generator
const randomContactName = () => {
const getCharFrom = set => set.charAt(
Math.round( Math.random() * ( set.length - 1 ) )
);
const getVowel = () => getCharFrom( 'aeiouy' );
const getConsonant = () => getCharFrom( 'bcdfghjklmnpqrstvwxz' );
let name = getConsonant() + getVowel() + getConsonant();
if ( Math.random() >= 0.5 ) {