All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.bower_components.globalize.src.util.to-string.js Maven / Gradle / Ivy

There is a newer version: 1.2.2.1-jre17
Show newest version
define(function () {

    /**
     * A toString method that outputs meaningful values for objects or arrays and
     * still performs as fast as a plain string in case variable is string, or as
     * fast as `"" + number` in case variable is a number.
     * Ref: http://jsperf.com/my-stringify
     */
    return function (variable) {
        return typeof variable === "string" ? variable : (typeof variable === "number" ? "" +
            variable : JSON.stringify(variable));
    };

});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy