10 XP challenge
Measure Every Value from Zero
easy
Build it yourself · 6 min
1 Learn2 Predict3 Solve
TaskYour mission
Return the absolute value of each item in numbers, preserving order. For example, -4 becomes 4 and 3 stays 3. numbers contains 0 to 30 integers from -100 to 100.
Examples
| Input | Return |
|---|---|
numbers = [-3,0,5]answer: [] → [3] → [3,0] → [3,0,5]. The result is [3,0,5]. | [3,0,5] |
numbers = [-1,-2]answer: [] → [1] → [1,2]. The result is [1,2]. | [1,2] |
Your code
Write your answer inside Solution, then use return to send it back.
Ln 1, Col 1
JavaScript
Try examples runs the public examples. Check my code checks your full answer and saves your completion.