var items = [
{
blue: false,
red: true
},
{
blue: false,
red: false
},
{
blue: false,
red: true
},
{
blue: false,
red: false
},
{
blue: false,
red: true
}
];
var result = 100 * items.filter(item => item.red).length / items.length;
alert(result + "%");