@JadedBlueEyes Eeek. That || instead of ?? is just painful to see. Repeatedly.
At my previous company we had one of our mid-level devs fall into this trap last year. Ended up failing in production in almost exactly this type of scenario, where the dev expected an array or undefined, but got true.
I have to wonder if this is an artifact of the initial training for these systems being on Python, which doesn't have a strong equivalent for ??. And, you know, the fact that these things don't actually understand the code they generate, as much as anyone may claim otherwise.