11 challenges match these filters
sortNumbers(arr) should sort an array of numbers from smallest to largest.
Logic error
sumAll(nums) should add up every number in the array, so sumAll([1, 2, 3]) returns 6.
Off-by-one
stepsToExceed(limit) counts how many times you must double 1 before passing limit, so stepsToExceed(8) returns 4.
Infinite loop
getName(id) should resolve to the loaded user's name, so getName(1) gives "user1".
Async race condition
capitalize(word) should upper-case the first letter, so "debug" becomes "Debug".
Off-by-one
qualifiesForFreeShipping(total) should return true when the order total is 50 or more — spending exactly 50 qualifies.
Logic error
firstItemName(items) should return the name of the first item, or "None" when the list is empty.
Null / Undefined
firstChunk(arr, size) should return the first `size` items of an array, so firstChunk([1,2,3,4,5], 3) gives [1,2,3].
Off-by-one
calculateTotal(items) should add up the price of every item and return the total, e.g. two items at 10 and 20 gives 30.
Type error
isEven(n) should return true if n is even, false otherwise.
Logic error
getUserCity(user) should return the user's city, or "Unknown" if the user has no address on file.
Null / Undefined