Here's the problem. A co-worker got a bizarre alert() dialog in a web app. It popped up and just said "1". It wasn't her code and she was completely stumped. That's how I got involved.
I looked around the code. Searched for errant /alert\(/, etc. Nothing worked.
Then I hit the developer console. I typed the best single thing I ever typed:
window.alert= msg=>{ console.log(msg); console.trace(); }
Yeh, I did that. You may enjoy my awesomeness.
Console.trace() gives a stack dump at the location that the alert dialog was called. That was very helpful.
You are welcome.