3 ms·
XMLHttpRequest is really not the way to make a request with modern JS, surprised this is what ChatGPT has to say. And the author, of course, can't know better,
by pcthrowaway 4y ago
XMLHttpRequest is really not the way to make a request with modern JS, surprised this is what ChatGPT has to say.
And the author, of course, can't know better, because ChatGPT didn't tell them about modern alternatives.
- lucsky 4y ago100% this. All the example I've already seen, along with this article and my own tests seem to indicate that ChatGPT is just utter shit at Javascript. When the answers aren't just 100% plain wrong, they are terribly misguided. So a generation of StackOverflow copy-pasters idiots will be replaced by another generation of GPT copy-pasters idiots. I'm not looking forward to that.
- imiric 4y agoChatGPT is trained on data from 2021. That's ancient history in JS time. :)
- pcthrowaway 4y agoEven in 2019 this was pretty much standard, but of course the training corpus includes over a decade of people saying to use xhr, so that's the issue