Bit harsh, as we've been telling you to use this, but it's good to know - module.exports is actually a node.js thing and throws an error in the browser -
logic.js:80 Uncaught ReferenceError: module is not defined
at logic.js:80
You can get around this by checking if module is defined in the environment in which the code is running (it is defined in node, but not in the browser)
if (typeof module !== 'undefined') {
module.exports = todoFunctions;
}
Bit harsh, as we've been telling you to use this, but it's good to know - module.exports is actually a node.js thing and throws an error in the browser -
You can get around this by checking if
module
is defined in the environment in which the code is running (it is defined in node, but not in the browser)Useful link