-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
incorrect check for arg undefined #26
Comments
I looked through the file for 'undefined' and found places where you are already doing the check that way. Are there other instances I should be looking for? |
@evhan55 there are a few places I'm doing it correctly (using typeof) but there are a lot of overloaded fxns where I'm distinguishing between types by checking if the last args exist. for example: https://github.com/lmccart/processing-js/blob/master/lib/pjs.js#L1016 should remove check if (x) and replace with if (typeof x === 'undefined'), etc. |
@lmccart cool, I see now, ok I will look for them Bocoup training also suggests treating method overloads with this check: if(arguments.length === 0) { then do this thing } |
@evhan55 oh that's a good point... go with that instead if you think it's better! |
@lmccart I'll stick with typeof for now and we can see later! |
closing for now and opening a new one about typeof vs. arguments |
needs to be
if (typeof variable === 'undefined')
The text was updated successfully, but these errors were encountered: