Im trying to add asterisks at the beginning and end of each word but I keep getting undefined at the end of my new string. Thanks for the help in advance.
function solution(s) {
var asterisks = "*"
var newString = ""
for(let i = 0; i <= s.length; i++){
if(s === ""){
return "*";
}else{
newString += asterisks + s[i];}
}
return newString;
}