about | help | code help+videos | done | prefs |
Given a non-empty array containing an even number of elements, return a new array consisting of the elements from the first half of the given array. For example, if the given array contains 6 elements, return a new array consisting of its first 3 elements. firstHalf([4, 7, 1, 5, 4, 2]) → [4, 7, 1] firstHalf([2, 8]) → [2] firstHalf([1, 2, 2, 1]) → [1, 2] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 200
Copyright Nick Parlante 2017 - privacy