function demo(string, times) { for (var i = 0; i < times; i++) { console.log(string); } } demo("hello, world!", 10);