Skip to content
← Back to Community
console.log not working
Profile icon
alloverskills

console

not sure what is happening. It works when there is only one file, but if there are pastes with files in it, nothing happens when printing

Voters
Profile icon
11irishjs
Profile icon
alloverskills
Comments
hotnewtop
Profile icon
[deleted]

your index.js is blank, thats why its not running

Profile icon
alloverskills

@TaylorLiang but what should be in there? i dont get it

Profile icon
[deleted]

@alloverskills require that file, so do require('./exer js/moduleA.js ')

Profile icon
alloverskills

@TaylorLiang Thanks a lot! I know that was a stupid question, but i didn't know that i should require every single file on index.js. I'm still a beginner. Have a nice day!

Profile icon
[deleted]

@alloverskills You have to require files if you want to execute them. Also heres a quick tip: If you want to require functions, like file.function, you have to put the functino in a module.exports = {put functions here}

Profile icon
alloverskills

@TaylorLiang Ok, thanks for the tip!

Profile icon
Kai_Justice

your index.js is blank, that's why its not working.

Profile icon
alloverskills

@Kai_Justice Thanks!

Profile icon
AdCharity

mark @TaylorLiang 's answer if he's right (which he is)