I did a benchmark test, and it turns out using prototypes makes a function call twice slower in Google Chrome, and in Firefox, it is 4-5 times slower!!! So, when you're writing a function library for strings where speed is of concern, then you should declare functions like this :
function truncate(str, length, pruneStr) { ... } // this is just an example
DO NOT USE PROTOTYPES. They needlessly slow down the execution of your code!
I did a benchmark test, and it turns out using prototypes makes a function call twice slower in Google Chrome, and in Firefox, it is 4-5 times slower!!! So, when you're writing a function library for strings where speed is of concern, then you should declare functions like this :
function truncate(str, length, pruneStr) { ... } // this is just an example
DO NOT USE PROTOTYPES. They needlessly slow down the execution of your code!