If you've been following my 30 day JavaScript Learning Challenge you might have noticed what we refer to in the business as a "service interruption". This is part of the reason that I moved over to Pelican (more on this in a later post). Suffice to say Wordpress is not particularly friendly when it comes to MArkdown and posting code samples on Wordpress is a bit of a pain in the ass.
Needless to say I'm a little behind with my 30 day JavaScript challenge. Worse, this weekend did not prove conducive for me to continue so I missed June 6-9th. Ugh.
One of my tirades was on how JavaScript typing drives me insane, but the post is lost and it's not important; JavaScript is what it is despite my complaints.
I did write a version of the classic Fizz Buzz problem in JavaScript. Here's my attempt:
var fizzbuzz = '';
for (var index = 1; index <= 100; index++){
fizzbuzz = '';
if (index % 3 == 0) {
fizzbuzz += 'Fizz';
}
if (index % 5 == 0) {
fizzbuzz += 'Buzz';
}
if (fizzbuzz.length !== 0) {
console.log(fizzbuzz);
} else {
console.log(index);
}
}
Probably won't win me any awards, but that closed out Chapter 2 of Eloquent Javascript.
Hopefully I'll be able to get back to this challenge tonight / tomorrow.