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

Use the String(string) form of string coercion #535

Merged
merged 1 commit into from
Aug 15, 2013
Merged

Use the String(string) form of string coercion #535

merged 1 commit into from
Aug 15, 2013

Commits on Aug 15, 2013

  1. Use the ('' + string) form of string coercion

    Using string.toString() will throw errors in current versions of Safari
    (6.0.5 currently) for some values. The error is a particularly cryptic
    "Type Error: type error", which no indication as to the value that
    caused the error. By using the '' + string form of coercion the error
    doesn't seem to occur.
    
    Depending on the browser used there is a sizable performance increase
    in using the concatenation form of coercion. In instances where there
    is not a performance improvement (i.e. Firefox), the speed difference
    is entirely negligable. See: http://jsperf.com/convert-to-string-bj/3
    sorentwo committed Aug 15, 2013
    Configuration menu
    Copy the full SHA
    d02c90c View commit details
    Browse the repository at this point in the history