Would it be cleaner to accumulate on a nested list and a current chunk, and push the current chunk on every false predicate? Then you can just filter out the empty lists after the reduce.
I realise this isn’t the troubleshooting thread but I need serious help on an issue that is driving me insane. My girlfriends computer keeps scrolling up forever on the windows start menu (and in other random situations that are really frustrating) I’ve tried unplugging all the hardware, I’ve tried various fixes from google including making a new user account and making sure background scrolling isn’t ticked I’ve restarted in safe mode and it still does it. I just reinstalled windows and it’s still happening. Hilariously it used to scroll down forever but recently it started scrolling up forever instead. It is breaking my brain plz halp!
I had the same issue and was caused because I had a game controller plugged into the computer that had fallen off my desk and was leaning on one of the joysticks. But if you’ve unplugged everything that doesn’t sound like it. How many mice have you tried?
I wish I had found the game controller before the reinstall of Windows… at least it was my game machine so nothing was lost. Jmakin has a point, have you been plugging the mice into different ports?
Any iOS devs around here? I may have a side project.
It seems like a tiktok-ish thing, so I assume it would need serious animation, graphics and sound integration skills. Which is why I’m not going to try to YOLO it myself.
Is it OK/idiomatic to use IIFEs in modern JS (TS if it matters)? My use-case is pretty dumb, I’m mostly just curious. I want to make a Map that’s keyed by a pair of numeric ids. The natural solution of [id1, id2] is a silent error (thanks JS!), so my initial hacky approach was to combine the ids as id1* BIG_CONST + id2. BIG_CONST seems like it should live in its own namespace, so I made an IIFE that returns an object IdPair with pack and unpack methods that reference the constant via closure. (After further consideration, I think the answer is just to stringify/parse the array, but ignore that for the moment…)
Would it be better to do this with a class or a module?
Module if its reused somewhere, otherwise IIFE is fine. I still use IIFEs when the alternative is a giant nested ternary. I haven’t made a class outside of React in 10 years.
I’ve been doing JS for 22 years and have almost never rolled my own object-oriented JS. I use whatever the idiom the framework provides or I don’t do it. I hate the class-based vs. prototypical inheritance question - because I have no feel for it IRL. I’m just regurgitating something I don’t really fundamentally grasp.
I had to walk a dev through some command line stuff and he didn’t know the $ notation was the shell prompt, so he kept telling me none of the commands were working and didnt know why. He was just copy pasting the entire line like:
$ echo “hello, world”
If you copy paste that whole thing, the shell tells you it can’t recognize the $, so it should’ve been obvious to him after a minute but we went in a circle for a sec before I realized what was going on. My bad for assuming people knew what that meant, but he obviously had never used the command line before.
Welcome to my world, trying to debug obscure issues :/ lots of dead ends before you find one post from like 2014 that has half the solution to the problem