Skip to content

Instantly share code, notes, and snippets.

@JoaoCnh
Created February 14, 2018 11:06
Filter example 2
var strings = ["hello", "Matt", "Mastodon", "Cat", "Dog"];
var filtered = strings.filter(function (str) {
return str.includes("at");
});
// ES6
const filtered = strings.filter(str => {
return str.includes("at");
});
console.log(filtered); // ["Matt", "Cat"];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment