get subtotal value from an array wich is selected? [duplicate]

I have a questions. Please do not close my questions.

I have a array like this

[
  {
   amount: 20,
   select: false
  },
  {
   amount: 27,
   select: true
  },
 {
   amount: 25,
   select: true
  },
  // Not limited
]

How can I get total amount only which is select true?

like-

total = 27 + 25 // Not should add 20 as it's select filed is false?