JSFiddle - React, Tailwind, and code Playground

JavaScript

var carToy, trainToy;

function setToyValue(name, description, toy = 'test') {
    toy = new makeToy(name, description);
}

function makeToy(name, description) {
    this.name = name;
    this.description = description;
}

function start() {
    setToyValue("toy car", "red, 4 wheels");
    setToyValue("train car", "green, with 5 wagons", trainToy);
    console.log(carToy);
    console.log(trainToy);
}

start();