jslint - How can I ensure that all of my JavaScript functions return a value? -
jslint - How can I ensure that all of my JavaScript functions return a value? -
i've had numerous bugs happening because of missing return in function. see, when of code write in ruby, it's easy forget explicit returns.
so i'd utilize similar jslint (which use) check functions homecoming something. yes, think it's improve explicitly homecoming when it's not required hunt downwards missing returns.
so, there tools check returns? or maybe can assert in runtime in simple manner?
please don't suggest coffeescript, i'm aware of existence.
jsunit example:
<script language="javascript" src="jsunitcore.js"></script> <script language="javascript"> function testwithvalidargs() { assertequals("somefunction should homecoming something", "expected homecoming value", somefunction(2, 3)); } </script> javascript jslint
Comments
Post a Comment