In my Node.js app I have a database layer that calls
toString on input parameters that need to be passed to the database as a string (for example, numbers). The places where I pass parameters to the library, should I call toString there too? On the one hand, I like being explicit. On the other, I'm calling
toString on something that is already a string. If that is unnecessary, I'd rather save the CPU cycles.
How costly is it to call
toString on a string?