I'm having a frustrating time trying to get this to work, Chrome keeps displaying an Uncaught Syntax error, but being a beginner to javascript, I have no idea where to look. Any help or pointers would be appreciated
function details(user) {
var fuel = prompt("Would you prefer petrol or diesel?");
var passengers = prompt("How many passengers will there be?");
var aircon = prompt("Do you require air-conditioning?");
var transmission = prompt("Do you want a Manual, Semi-Automatic or Automatic Transmission?");
var hire = prompt("How long would you like to hire a vehicle for? (Day Hire, Weekend Hire or Weekly Hire)");
if (fuel == "petrol" && passengers == "2" && aircon = "yes" && transmission == "semi-automatic") {
result = "Lambourghini Aventador";
} else {
result = "some form of SUV"
}
if result = "Lambourghini Aventador") {
if (hire == "Day hire") {
cost = 2000;
}
if (hire == "Weekend hire") {
cost = 3800;
}
if (hire == "Weekly hire") {
cost = 12000;
}
}
}