Trim Function In Javascript With Parameters Definition