I continue with this exercise. setpoint
Based on the technical definitions taken with the equipment, you must declare the cars variable. This must contain the following vehicles: The first car is a Blue Ford Fiesta, from 2019, with 200 kilometers, whose price is 150,000, available in 12 installments, with the patent APL123 that is not sold. The second car is a White Toyota Corolla, from 2019, 0 kilometers, whose price is 100,000, available in 14 installments, with the patent JJK116 that is not sold. Each car must have the following attributes: brand, model, price, km, color, fees, year, patent, sold.
My exercise:
function Auto(marca, modelo, precio, km, color, cuotas, anio, patente, vendido){
this.marca=marca
this.modelo=modelo
this.precio=precio
this.km=km
this.color=color
this.cuotas=cuotas
this.anio=anio
this.patente=patente
this.vendido=vendido
}
let autos =new Auto (["Ford"],["Fiesta"],150000,200,["Azul"],12,2019,["APL123"],false)
console.log(autos)
module.exports=autos
It throws me the following errors:
- The variable "cars" must contain an array of cars
- The list must contain literal objects with the following properties: brand, model, price, km, color, installments, year, patent and sold. This test tests the first element.
- The attributes of the car object must store the following types of data: brand (string), price (number), km (number), color (string), quotas (number), year (number), patent (string) and sold ( boolean). This test tests the first element
I'm really confused, in Visual Studio Code, it runs fine for me but on the platform where it asks me for the exercise, it doesn't accept it.
I can't understand the mistakes
What you are asking for is an array, not an object in the response. That's why you must insert each object in that array. You also enter the strings as arrays, so the data types in the test do not match.
You would have to enter the other car to complete the code.