is class a type of function in js code example Example: javascript create class class Car { constructor(brand) { this.carname = brand; } }