letstr="Perl Weekly Challenge!";letcnt=0;letnewstr="";for(letcofstr){if(c=="e"){c="E";cnt++;}document.write(c);newstr+=c;}console.log(newstr);document.write("\n<br>There were ",cnt," e's in the sentence.");console.log("\nThere were ",cnt," e's in the sentence.");