function myFunc(...hero) { console.log(hero.length); } myFunc(); // 0 myFunc("Iron Man"); // 1 myFunc("Iron Man", "Bat Man", "Super Man"); // 3