I would like to find a way to programmatically (i.e. by writing code) find for what values of x we have the expression x == null evaluating to true.
I would like to find a way to programmatically (i.e. by writing code) find
Share
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.
It is impossible to (without prior knowledge of at least the basic JavaScript rules) be able to programmatically determine all values of
xfor whichx == nullis true. However, the following should show a pattern from which a heuristic can be derived:(This particular test case does cover all the times when it would be true.)
Similar tests can be done for
== false, etc.Happy coding.
See Ray Toal’s answer for more suggestions of test values.