how to write methods for class in javascript code example Example: javascript create class class Car { constructor(brand) { this.carname = brand; } }