Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function carToGo (input) {
- let budget = Number(input[0]);
- let season = input[1];
- let classCar = 0;
- type = 0;
- if (budget <= 100) {
- classCar = "Economy class";
- if (season === "Summer") {
- type = "Cabrio"
- } else {
- type = "Jeep"
- }
- } else if (budget <= 500) {
- classCar = "Compact class";
- if (season === "Summer") {
- type = "Cabrio"
- } else {
- type = "Jeep"
- }
- } else {
- classCar = "Luxury class";
- type = "Jeep";
- }
- console.log(type)
- }
- carToGo(["450", "Summer"]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement