The code below works, but my gut tells me this isn't the most succinct way to do this. I'd like to use this.function2()
instead of videoControler.function2()
, but that doesn't work. Is this the best way to write this?
const myController = {
function1() {
return res.json({
blah: myController.function2()
})
},
function2() {
return "blah"
}
}