Jarren Bird8,118 Points
why don't i have to require my weather.js file in app.js?
in this project, andrew has an app.js file, a weather.js file, and an api.json file. the weather.js file has a function that app.js uses. so it would make sense that the app.js file has to require the weather.js file in order to get that function. and this is the way that andrew has it set up in his video.
but when i require the weather.js file in app.js, like this:
const weather = require('./weather');
i get an error. the error i get is:
"Identifier 'weather' has already been declared"
if i remove that line, then everything seems to work like it's supposed to.
so my question is: why does andrew have to require weather.js and i don't?