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