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

When this conditional expression can be better than anything else? #134

Open
chiefGui opened this issue Jul 17, 2014 · 0 comments
Open

When this conditional expression can be better than anything else? #134

chiefGui opened this issue Jul 17, 2014 · 0 comments

Comments

@chiefGui
Copy link

Hello guys.

In this conditional pattern doc, you say:

Using the normal pattern will generally outperform the regex (alternative method 1) in a loop, [...]"

Then I made a little test – still doubtful, but can give us an idea: Conditional Expressions Difference.

I really was expecting that regex would be faster/better outside a loop – as I outputted on the alert() – but it doesn't seem to happen.

Yes, I know – jsPerf isn't the most trustful way of performance rating, but as I said, it can give us a starting point.

So, what does "outperform" really means?

@chiefGui chiefGui changed the title Where this conditional expression can be better than anything else? When this conditional expression can be better than anything else? Jul 17, 2014
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