I have a function in which I’d like to return an Object or false.
Is a return type of * ok to use? are there any downfalls to this? (besides it being a bit lazy in some cases).
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could also return
nullinstead offalse. Then your return type could still beObject.For my taste, an Object is still too vague. Almost everything is an Object in ActionScript.
The more specific your types, the more errors are caught by the compiler before you run it. Strict typing is your friend!