Had to be. And don't get me wrong - I'm fine with a code challenge, but there's got to be some structure to it.
Code challenges
maxxd The FizzBuzz one was fun to do
for(i = 1 ; i <= 100; i++ ){
var is3 = i % 3 === 0;
var is5 = i % 5 === 0;
if(is3 && is5){
console.log("FizzBuzz");
}
else if(is3){
console.log("Fizz");
}else if(is5){
console.log("Buzz");
}
else{
console.log(i);
}
}
That's a good one - it was actually a five-minute live code challenge I did on an interview just the other week.
maxxd I still remember your interface stuff from a while ago, I'm surprised you have to do anything like that
Thanks - that's very kind. But yeah, still gotta do the coding challenges - think I've done five or six over the last year. Hopefully soon I'll actually land the gig!
I'm sure you'll be fine - I'm just getting old and I live in a small market.
cluelessPHP I'm trying to count vowels in a name now
Hmm...how do you decide if "Y" is a vowel or a consonant in a given case?
- Edited
NogDog I just found out you Franklin fellow wanted to replace it with an i. Merriam-webster says it's mostly a vowel, toss a coin I guess if it's heads it's a vowel?
That's an idea, some ip thingy or something
OR something like this...
https://jsfiddle.net/a8tv0so3/
I am going to play around with it more later, I'm sure ternary operators can replace a lot of it
To avoid some repetition, you could do:
}else{
if(!Y.checked){
const counting = val.match(/[aeiou]/gi).length;
}else{
const counting = val.match(/[aeiouy]/gi).length;
}
output.innerHTML = counting;
document.body.appendChild(output);
}
NogDog Stealing a leaf out of your book seems more fun