function and class inside object javascript code example Example: variables in js class constructor(){ this.foo = bar }