Created
April 25, 2019 07:03
-
-
Save lyquangthai1993/26bc437bd7b8f6495e77173b81d89121 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
const languages = [ | |
{ | |
name: 'C', | |
year: 1972 | |
}, | |
{ | |
name: 'C#', | |
year: 2000 | |
}, | |
{ | |
name: 'C++', | |
year: 1983 | |
}, | |
{ | |
name: 'Clojure', | |
year: 2007 | |
}, | |
{ | |
name: 'Elm', | |
year: 2012 | |
}, | |
{ | |
name: 'Go', | |
year: 2009 | |
}, | |
{ | |
name: 'Haskell', | |
year: 1990 | |
}, | |
{ | |
name: 'Java', | |
year: 1995 | |
}, | |
{ | |
name: 'Javascript', | |
year: 1995 | |
}, | |
{ | |
name: 'Perl', | |
year: 1987 | |
}, | |
{ | |
name: 'PHP', | |
year: 1995 | |
}, | |
{ | |
name: 'Python', | |
year: 1991 | |
}, | |
{ | |
name: 'Ruby', | |
year: 1995 | |
}, | |
{ | |
name: 'Scala', | |
year: 2003 | |
} | |
]; | |
const regex = new RegExp('^' + 'on', 'i'); | |
languages.filter(language => regex.test(language.name)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment