when I try cd, console says "cd is not defined"
In Chrome Devtools, the "context switcher" is available at the bottom of the page. See the <top frame>
dropdown? In there you can change where your script is executing from. This is the same, effectively, as cd()
.
This is explained more in https://stackoverflow.com/a/8581276/89484