JavaScript: Demonstrating function with parameters