Skip to content

use implicit string conversion instead of String constructor#216

Closed
marijaselakovic wants to merge 1 commit into
tj:masterfrom
marijaselakovic:master
Closed

use implicit string conversion instead of String constructor#216
marijaselakovic wants to merge 1 commit into
tj:masterfrom
marijaselakovic:master

Conversation

@marijaselakovic
Copy link
Copy Markdown

Hi,
I would propose few optimizations:

  1. Use implicit string conversion, instead of String constructor. Especially if the expected input is string, like in functions: capitalize, downcase, upcase, truncate, truncate_words and replace (jsperf test: http://jsperf.com/implicitstringconversion)

  2. Instead of js.substr(0,1), use equivalent js[0].

@marijaselakovic marijaselakovic closed this by deleting the head repository Feb 15, 2024
@limitLam
Copy link
Copy Markdown

limitLam commented Feb 15, 2024 via email

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

Successfully merging this pull request may close these issues.

2 participants