var passengers = [
{name: 'Jane Doloop', paid: true},
{name: 'Dr. Evel', paid: true},
{name: 'Sue Property', paid: false},
{name: 'John Funcall', paid: true}
]
var paidPassengers = passengers.filter(item=> item.paid).length
var notPaidPassengers = passengers.filter(item=> !item.paid).length
console.log(`оплатили: ${paidPassengers}`)
console.log(`не оплатили: ${notPaidPassengers}`)
|