Are you participating in the Advent of code this year?
If you don't know what the advent of code is, it's a website where you'll find a daily challenge (every day it gets harder). It's a really fun event, you should participate!
Here is my solution for day #3:
[ [1, 1], [3, 1], [5, 1], [7, 1], [1, 2], ] .map( ([RIGHT, DOWN]) => $('body > pre') .textContent.split(/\r?\n/) .filter(Boolean) .filter((_, index) => index % DOWN === 0) .filter((value, index) => value[(index * RIGHT) % value.length] === '#').length, ) .reduce((acc, v) => acc * v, 1)
Feel free to share yours in the comments!