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

[Codewars] Reverse List Order (8 kyu) / JavaScript

by fluss 2023. 4. 13.

https://www.codewars.com/kata/53da6d8d112bd1a0dc00008b

 

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:

In this kata you will create a function that takes in a list and returns a list with the reverse order.

 

Examples (Input -> Output)

* [1, 2, 3, 4]  -> [4, 3, 2, 1]
* [9, 2, 0, 7]  -> [7, 0, 2, 9]

 

코드

function reverseList(list) {
  return list.reverse();
}

댓글