Mad_Griffith Posted November 20, 2019 Share Posted November 20, 2019 (edited) I have the following data: module.exports = { get myProp() { return { ExternalModuleObject, } = require("./myexternalmodule") } init: function() { myprop = new ... } } How to correctly create an ExternalModuleObject's instance inside init()? Edited November 20, 2019 by Mad_Griffith Link to comment Share on other sites More sharing options...
Mad_Griffith Posted November 21, 2019 Author Share Posted November 21, 2019 And also in this case: module.exports = { get myProp() { mySubProp: { return { ExternalModuleObject, } = require("./myexternalmodule") } }, init: function() { myprop = new ... } } Link to comment Share on other sites More sharing options...
Ingolme Posted November 21, 2019 Share Posted November 21, 2019 This is not valid Javascript syntax, you can't have a literal value on the left side of an assignment operator. Maybe that's a thing in Node.js, but I don't have any experience with that. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now