declaring a function which is only accessible in a class in javascript code example Example: variables in js class constructor(){ this.foo = bar }