Sum of two numbers
This is a warmup question, so take your time and focus more on exploring the editor's features rather than the challenge.
Objective: Write a function that takes two numbers as input and returns their sum.
Instructions:
- Write a function named
sum
that accepts two arguments (both numbers).
- The function should return the sum of the two input numbers.
Expected Output:
sum(5, 3); // Output: 8
sum(10, -2); // Output: 8
Requirements:
- Function should return the sum of the two input numbers
- Function works correctly with both positive and negative numbers
- Function handles invalid inputs