terryds Posted October 12, 2013 Share Posted October 12, 2013 What's the difference between returning null (with no value) or return FALSE ? I'm a bit confused about which to choose... Can you give me the implementation of those two and explain the essential to me? Link to comment Share on other sites More sharing options...
Ingolme Posted October 12, 2013 Share Posted October 12, 2013 "false" is a value. It's a boolean value indicating that a condition is false. If you're not planning to do anything with the return value of the function there's no different between null, false, "n" or 5. A function might return false if something didn't work properly and other values if it did work. You return null if you don't expect the function to return anything the developer wants. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now