JSFiddle - React, Tailwind, and code Playground

by Ali Adravi

JavaScript

(function(){
    function Car(wheels, color){
        carWheels = wheels;
        carColor = color;
        return{
            getWheels: function(){
                return carWheels
            },
            setWheels: function(wheels){
                carWheels = wheels;
            },
            getColor: function(){
                return carColor;
            },
            setColor:function(color){
                carColor= color;
            }
        }
    }
    
    debugger;
    var car = new Car(4, 'White');
		console.log(car.getColor());
    var x = car.carWeels;
})();