Just a heads up, I'm currently coding in Codecademy which might be causing some quirks.
I've been working on a task to remove all punctuation from an array called dupBW and convert everything to lowercase.
Interestingly, my code appears to work fine within the forEach loop as indicated by console.log. However, when I check dupBW at the end, it seems unchanged.
Any assistance would be greatly appreciated.
dupBW.forEach(dupWord => {
if(puncArray.includes(dupWord[dupWord.length-1])) {
dupWord = dupWord.slice(0, dupWord.length-1);
dupWord = dupWord.toLowerCase();
console.log(dupWord);
}
});
console.log(dupBW.join(' '));