V
V
Vladimir2019-11-15 12:24:35
Node.js
Vladimir, 2019-11-15 12:24:35

Why does it not see connected modules when connecting a file?

Good afternoon. Please tell me why this code will not work?
config.js

(function log() {
  sayToConsole('All working!')
}())

app.js
function sayToConsole(text) {
  console.log(text)
}
require('./config.js')

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
fgvnovoross, 2019-11-24
@fgvnovoross

Because you didn't send them to this included file?...
https://learn.javascript.ru/import-export
It's like

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question