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