function Car() {
const fuel = 50
return {
fuel
}
}
const car = Car();
console.log(car);
I happened to see the code above, and I thought the value of car would be 50, but strangely, car became an object. Can you tell me why car is an object? I happened to see it in the link below. Why use getters and setters in JavaScript?