how to run a function defined in a class js code example Example: variables in js class constructor(){ this.foo = bar }