Why "this." doesn't work, and how to make it work?

var car = {
    name: "tesla",
    speed: 200,
    gas: 20 //%
};

var gasUsage = function(obj) {
    return (this.gas / 100) * speed;
}

Because gasUsage is completely separate from car. In order to use this, you would want gasUsage to be a method of a car object.

Also, this.speed should be used,because if this is omitted, speed will be not defined

and therefore,error will be thrown.