const programmingLanguages =[
{"id": 1,"name": "JavaScript","released_year": 1995,"githut_rank": 1,"pypl_rank": 3},
{"id": 2,"name": "Python","released_year": 1991,"githut_rank": 2,"pypl_rank": 1},
{"id": 3,"name": "Java","released_year": 1995,"githut_rank": 3,"pypl_rank": 2},
{"id": 4,"name": "TypeScript","released_year": 2012,"githut_rank": 7,"pypl_rank": 10},
{"id": 5,"name": "C#","released_year": 2000,"githut_rank": 9,"pypl_rank": 4}
];
// 1. Map
const programmingLanguageNames = programmingLanguages.map(programmingLanguage => programmingLanguage.name);
console.log(`All programming language names pulled in with map function: ${programmingLanguageNames.join()}`)
// 2. Filter
const zenZProgrammingLanguages = programmingLanguages.filter(programmingLanguage => programmingLanguage.released_year >= 2000);
console.log('Filter out the programming languages release on or after 2000: ', zenZProgrammingLanguages);
// 3. Some
const hasLanguageReleasedin1991 = programmingLanguages.some(programmingLanguage => programmingLanguage.released_year === 1991);
console.log(`Do we have any programming language in our list that was released in 1991? The answer is: ${hasLanguageReleasedin1991} using "some" function`);
// 4. Every
const allAmongTop10InGitHut = programmingLanguages.every(programmingLanguage => programmingLanguage.githut_rank <= 10);
console.log(`Are all programming languages in our list among top 10 on GitHut? The answer is: ${allAmongTop10InGitHut} using "every" function`);
// 5. Find
const mostPopularLangaugeOnPypl = programmingLanguages.find(programmingLanguage => programmingLanguage.pypl_rank === 1);
console.log(`The most popular programming language as per PYPL index is: ${mostPopularLangaugeOnPypl.name}`);
const days = ["Monday" , "Tuesday", "Wednesday", "Thursday" , "Friday", "Saturday", "Sunday"];
// 6. Includes
const isSundayADay = days.includes("Sunday");
const isFundayADay = days.includes("Funday");
console.log(`Is Sunday a day? Answer:...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Fiddle Pages
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Get Fiddle Pages with PRO
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.