Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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
You can’t perform that action at this time.