본문 바로가기
알고리즘/Codewars

[Codewars] Enumerable Magic - Does My List Include This? (8 kyu) / JavaScript

by fluss 2023. 3. 26.

https://www.codewars.com/kata/545991b4cbae2a5fda000158

 

Codewars - Achieve mastery through coding practice and developer mentorship

A coding practice website for all programming levels – Join a community of over 3 million developers and improve your coding skills in over 55 programming languages!

www.codewars.com

 

DESCRIPTION:

Create a method that accepts a list and an item, and returns true if the item belongs to the list, otherwise false.

 

코드

function include(arr, item){
  return arr.includes(item);
}

댓글