Answer the question
In order to leave comments, you need to log in
What's the best way to code in node.js?
Hello. There are two spellings. Which one is more correct?
const myModule = require('./libs/module');
//вариант первый
function func (one, two) {
//some code
let a = myModule.func(one);
//some code
let b = myModule.someFunc(two)
}
func(1, 2);
//вариант второй
function func (one, two, myModule) {
//some code
let a = myModule.func(one);
//some code
let b = myModule.someFunc(two)
}
func(1, 2, myModule);
Answer the question
In order to leave comments, you need to log in
IMHO...
const {func, someFunc} = require('./libs/module');
//вариант первый
function myfunc (one, two) {
//some code
let a = func(one);
//some code
let b = someFunc(two)
}
myfunc(1, 2);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question