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

Minor question about the source code #25

Closed
anwerso opened this issue Oct 7, 2015 · 2 comments
Closed

Minor question about the source code #25

anwerso opened this issue Oct 7, 2015 · 2 comments

Comments

@anwerso
Copy link

anwerso commented Oct 7, 2015

if (fromEl.tagName != 'TEXTAREA') {

Is there any particular reason to not use strict equality comparison here?

@patrick-steele-idem
Copy link
Owner

The only reason I don't use strict equality is because I can save a byte and I am not concerned about type coercion since I know both the left hand side and the right hand side are strings.

Since you asked, I'm not of the opinion that strict equality checks should always be used. There's lots of situations where == or != produces better code. It's just more important that the JavaScript language is understood and used appropriately...

I hope that clarifies :)

@anwerso
Copy link
Author

anwerso commented Oct 9, 2015

It definitely clarifies :)

@anwerso anwerso closed this as completed Oct 9, 2015
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

2 participants