Skip to content

Instantly share code, notes, and snippets.

View Babali42's full-sized avatar
🕸️
Go on drumbeatrepo make some noise

Baptiste Lyet Babali42

🕸️
Go on drumbeatrepo make some noise
View GitHub Profile
@Babali42
Babali42 / fizzbuzz.js
Created April 3, 2025 22:01 — forked from edwingustafson/fizzbuzz.js
FizzBuzz is RxJS
#!/usr/bin/env node
const fizz = "Fizz";
const buzz = "Buzz";
const fizzbuzz = `${fizz}${buzz}`;
const Rx = require('rxjs/Rx');
Rx.Observable.range(1,100)
.map(n => n % 15 === 0 ? fizzbuzz : (n % 3 === 0 ? fizz : (n % 5 === 0 ? buzz : n)))