I would like to find by effective way, because of code nesting
if (price && car.price < price.value) {
return car
}
if (tachometer && car.tachometer < tachometer.value) {
return car
}
if (cars.length > 0 && cars.includes(car.name.split(' ')[0])) {
return car
}
if (colors.length > 0 && colors.includes(car.color)) {
return car
}
if (fuel && car.fuel === fuel.text) {
return car
}
turn into all posible conditions
if (price && car.price < price.value) {
if (tachometer && car.tachometer < tachometer.value) {
if (...
}
}