Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var pickRandomWords = function (words) {
- return words[Math.floor(Math.random() * words.length)];
- }
- var choiceGender = prompt('U gender ?');
- var maleNames = ['Andry', 'Abraham', 'Arnold', 'Arnold', 'Carl', 'Donald', 'Gabriel', 'Gerald', 'John'];
- var famaleNames = ['Adriana', 'Ana', 'Catherine', 'Ellen', 'Tina', 'Victoria', 'Pat', 'Maureen'];
- var maleGender = ['Male', 'male', 'man', 'Man'];
- var famaleGender = ['Famale', 'famale', 'woman', 'Woman'];
- if (choiceGender === maleGender) {
- alert('Are you ' + pickRandomWords(maleNames));
- } else if (choiceGender === famaleGender) {
- alert('Are you ' + pickRandomWords(famaleNames));
- } else {
- console.log('no');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement