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

[Codewars] Small enough? - Beginner (7 kyu) / JavaScript

by fluss 2023. 3. 8.

https://www.codewars.com/kata/57cc981a58da9e302a000214

 

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:

You will be given an array and a limit value. You must check that all values in the array are below or equal to the limit value. If they are, return true. Else, return false.

You can assume all values in the array are numbers.

 

코드

function smallEnough(a, limit){
  return a.every(el => el <= limit);
}

댓글