Created
June 24, 2017 06:05
-
-
Save lubien/4dfcfab6756826589fbf06bfcd048023 to your computer and use it in GitHub Desktop.
Meeting Lambda #13: Quantification - Validate Posts
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
const validPost = post => | |
post.title && post.title.length > 10 && post.content | |
const posts = | |
[ {title: 'short'} | |
, {title: 'fairly long', content: 'Foobar'} | |
, {title: 'yet another', content: 'fixture'} | |
] | |
const validPosts = posts.every(validPost) | |
console.log(validPosts) // false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment