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
3 Replies