Share this postDon't stomp variablescodefaster.substack.comCopy linkFacebookEmailNoteOtherDon't stomp variablesTyler AdamsNov 10, 20211Share this postDon't stomp variablescodefaster.substack.comCopy linkFacebookEmailNoteOther2ShareDon’t do:text = text.split(delimiter)Instead do:const a = text.split(delimiter)That way at the end of the program you can addconsole.log({a, text})and see both the array and the original text
This makes sense in the case where the variable doesn't take up a lot of memory - stomping can make sense if you have a giant object (e.g. big pandas array) that you transform several times in the method