**HEY Checkout my fortune car Teller**

It was FUN, :heart_eyes:
it took about 20min

Furtune_Car

Love U CodeCademy:heart:

Using your code as the basis, here is a version using getters…

const message = {
  _type: [" brand new", "n old,", " rusty,"],
  _color: ["black", "white", "red", "silver"],
  _car: ["Benz", "Corvette", "BMW", "Dodge"],
  rnd (n) {
    return Math.floor(Math.random() * n)
  },
  get type () {
    return this._type[this.rnd(this._type.length)];
  },
  get color () {
    return this._color[this.rnd(this._color.length)];
  },
  get car () {
    return this._car[this.rnd(this._car.length)];
  },
};
const FortuneTeller = () => {
    console.log(`\nYour Future Car is:\n** A${message.type} ${message.color} ${message.car} **\n`)
};

FortuneTeller();

I tweaked the grammar a smidge and abstracted away the Math stuff.

1 Like

WoW, Nice :clap::smirk:
, But, I don’t really get along with getters :man_shrugging:t2: , I really like a hero function to do all kinds of stuff and save the project :man_superhero:

1 Like

In the above, remove get and all the backing prefixes, then add () to the string literal expressions.

${message.type()}
1 Like

Cool :heart_eyes::heart_eyes::heart_eyes:
I’m impressed :smirk:

1 Like