Thursday 19 November 2015

help with requiring and calling local file

I'm having trouble with linking in a local file to my app - my file is called algorithm.js and inside isvar algorithm = function(){ var test = function(){ console.log("test"); } } module.exports = algorithm; in my app I havevar algorithm = require('./algorithm.js'); algorithm.test(); and I'm getting back "algorithm.test is not a function"

Submitted November 19, 2015 at 07:45PM by wheyisbae

No comments:

Post a Comment