Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
nano3908yThat's clearly crap but never understood whether best practice for returning array of one should be [{}] or {}. Always annoys me having to deal with it as {} but loads of established APIs seem to have that approach.
-
shizpi958y@WhatIsHeDoing this is a different case. I agree with 200 and getting [ ] for and empty list.
But this is a case where there's no data and you get [ null ]
Related Rants
F*cking backend guys that send empty arrays like [ null ] ...
array.length === 0 -> false
undefined
backend
array
api
api design