Answer the question
In order to leave comments, you need to log in
How to get the this of a class in node.js?
There is a class:
#index.js
function DB() {
this.token = 'token';
}
DB.prototype.getData = require('./get')
module.exports = new DB;
# get.js
module.exports = function () {
var self = this;
console.log(self.token) // как получить свойство класса?
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question