So I'm supposed to write a function called laugh() that takes one parameter, num that represents the number of "ha"s to return. In the course I'm taking to learn JavaScript it doesn't explain clearly the purpose of the var ha = ''; Why is this string empty and what's the purpose of it being empty? Thanks for the help in advance.
function laugh(num) {
var ha = '';
for (i = 0; i < num; i++) {
ha = ha + 'ha';
}
return ha + '!';
}
console.log(laugh(3));