Hello,
I’m done with the Mini Linter Project just a few minutes ago.
I solved the third task which of step 8.
(Replaced overused words with something else.)
I wanna share my code and discuss with you guys whether it is okay or not.
Here is the link to the project.
Mini Linter
And, here is my code!
while(storyWords.indexOf('really') != -1) {
storyWords.splice(storyWords.indexOf('really'), 1, 'OMG');
}
while(storyWords.indexOf('very') != -1) {
storyWords.splice(storyWords.indexOf('very'), 1, 'OMG2');
}
while(storyWords.indexOf('basically') != -1) {
storyWords.splice(storyWords.indexOf('basically'), 1, 'OMG3');
}
console.log(storyWords.join(' '));
//The result is
//Last weekend, I took literally the most beautiful bike ride of my life. The route is called "The 9W to Nyack" and it actually stretches all the way from Riverside Park in Manhattan to South Nyack, New Jersey. It's OMG an adventure from beginning to end! It is a 48 mile loop and it OMG3 took me an entire day. I stopped at Riverbank State Park to take some extremely artsy photos. It was a short stop, though, because I had a OMG long way left to go. After a quick photo op at the OMG2 popular Little Red Lighthouse, I began my trek across the George Washington Bridge into New Jersey. The GW is actually OMG2 long - 4,760 feet! I was already OMG2 tired by the time I got to the other side. An hour later, I reached Greenbrook Nature Sanctuary, an extremely beautiful park along the coast of the Hudson. Something that was OMG2 surprising to me was that near the end of the route you actually cross back into New York! At this point, you are OMG2 close to the end.
Welcome any idea or opinion of yours.
Thank you.