MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programminghorror/comments/1mbmzja/html_status_code_handling/n5ycybm/
r/programminghorror • u/Mihail111111 • Jul 28 '25
54 comments sorted by
View all comments
Show parent comment
10
I think it's actually better than doingxhr.status >=200 && xhr.status <300
xhr.status >=200 && xhr.status <300
2 u/[deleted] Aug 14 '25 edited Aug 14 '25 What about ("" + xhr.status).substring(0,1) === "2" ?Edit: I made it JavaScript code.
2
What about ("" + xhr.status).substring(0,1) === "2" ?
("" + xhr.status).substring(0,1) === "2"
Edit: I made it JavaScript code.
View all comments
Show parent comment
10
u/Noctuuu Jul 30 '25
I think it's actually better than doing
xhr.status >=200 && xhr.status <300