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

07-string-reverse-solition.js #18

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

07-string-reverse-solition.js #18

wants to merge 3 commits into from

Conversation

lacyjpr
Copy link

@lacyjpr lacyjpr commented Oct 20, 2019

Just another way to reverse a string.

I'm interested in figuring out which is more efficient.

Part of that involves figuring out what array.reverse() does under the hood.

@Kornil
Copy link
Owner

Kornil commented Nov 7, 2019

You can create a test on https://jsperf.com/ to measure the performance of both approaches. Feel free to report the results back!

@Kornil Kornil added enhancement New feature or request question Further information is requested and removed enhancement New feature or request labels Nov 7, 2019
@lacyjpr
Copy link
Author

lacyjpr commented Nov 8, 2019

On jsperf, I get either that the two are the same, or that using concat is 1%-3% faster.

I don't know when anyone will need 0-3% more speed reversing a string though:)

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

Successfully merging this pull request may close these issues.

2 participants