.Some() and .Every() in Javascript

const characters = [
{
name: 'Luke Skywalker',
height: 172,
mass: 77,
eye_color: 'blue',
gender: 'male',
},
{
name: 'Darth Vader',
height: 202,
mass: 136,
eye_color: 'yellow',
gender: 'male',
},
{
name: 'Leia Organa',
height: 150,
mass: 49,
eye_color: 'brown',
gender: 'female',
},
{
name: 'Anakin Skywalker',
height: 188,
mass: 84,
eye_color: 'blue',
gender: 'male',
},
];
const shorterThan200 = characters.every( character => character.height < 200)console.log(shorterThan200)
const anyBlueEyes = characters.some(character => character.eye_color === 'blue)console.log(anyBlueEyes)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store