Created
May 17, 2020 22:15
-
-
Save Yigaue/4a30f785b99759eecfc55ec2533624f0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let data = [ | |
{id: 1, title: 'Nite watch', price: 33, discount:0}, | |
{id: 2, title: 'what I want', price: 12, discount:0.4}, | |
{id: 3, title: 'Mercy at last', price: 405, discount:0.25}, | |
{id: 4, title: 'Nothting between', price: 550, discount:0} | |
]; | |
let discountedBooks = data.every(item => item.discount > 0 ); | |
console.log(discountedBooks); | |
// result | |
false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment