6 ms·
The usage of `unless` strikes me as unmaintainable and "smart", not in a good way tbh. The types are all other the places, too. What is it even doing exactly? A
by neysofu 5y ago
The usage of `unless` strikes me as unmaintainable and "smart", not in a good way tbh. The types are all other the places, too. What is it even doing exactly? Appending a string to a null value..?
- zamadatix 5y agoAs is it's just doing the first 100 iterations of fizzbuzz as either a number or text depending on the fizzbuzz step but not printing or saving anything. If you wrap it in a console.log() it'll create a 100 element array of objects which are the answer for fizzbuzz[index+1] and log them. All that said I've never been a fan of dynamically typed languages myself. Fast to make things in but difficult to reason about later.
- mhio 5y ago> Appending a string to a null value..? Appending a string to an undefined value, via array addition, which turns them into strings but doesn't turn null into 'null' or undefined into 'undefined'. It's a bit of a hack. `'a' + undefined === 'aundefined'` `[ 'a' ] + [ undefined ] === 'a'` Also the empty string '' evaluates to false. `[ undefined ] + [ undefined ] == ''` This is wat - https://archive.org/details/wat_destroyallsoftware https://archive.org/details/wat_destroyallsoftware
- rmetzler 5y ago// Generated by CoffeeScript 2.4.1 (function() { var i, j; for (i = j = 1; j <= 100; i = ++j) { [!(i % 3) ? 'fizz' : void 0] + [!(i % 5) ? 'buzz' : void 0] || i; } }).call(this);