Skip to content
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

logical OR shouldn't use booleans #251

Closed
gfwilliams opened this issue Mar 3, 2014 · 0 comments
Closed

logical OR shouldn't use booleans #251

gfwilliams opened this issue Mar 3, 2014 · 0 comments

Comments

@gfwilliams
Copy link
Member

From http://forum.espruino.com/conversations/625/#comment9253:

For example people might do:

var com = com || {};
com.mynamespace = com.mynamespace || {};
com.mynamespace.MyClass = function(){
    ...
};

Expecting that || returns com if it is not undefined. In Espruino it just returns 0 though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant