Function overloading for JavaScript, my way