I have this code:
function myFunction() {
console.log("Something")
this.somethingElse = event => console.log("Something else")
}
When I evoke the function using myFunction()
I get Something printed out in the console. But evoking myFunction.somethingElse()
throws an error saying myFunction.somethingElse()
is not a function.
What am I getting wrong?