Confused about the return type of this function
So i have a function which fetches the user. My goal is to return user if exists else return null. However in order to achieve this i need to manually check the length of the response and if its zero i return null. Overall my code looks so much duplicated and verbose. I tried using this but this doesnt shows null as return type
![No description](https://cdn.answeroverflow.com/1263565175764680774/image.png)
3 Replies