about | help | code help+videos | done | prefs |
middleValue
Given an array of integers, return the middle value if the length is odd, return the average of the two middle values if the length is even, and return zero if the length is zero. middleValue([9, 8, 6, 9, 9]) → 6.0 middleValue([2, 5, 2, 4, 3, 5, 2]) → 4.0 middleValue([1, 6, 5, 4, 7, 2]) → 4.0 ...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