Beginner
The Sum of Two Numbers
Description
Your task is to create a reusable function that takes exactly two parameters and returns their sum.
- Input validation – The function should accept exactly two parameters and ensure they are numbers.
- Correct output – The function should return the sum of the two input values.
- Reusability – The function should be written in a way that can be easily reused in different parts of an application.
Example Usage
sumOfTwoNumbers(8, 12); // Expected output: 20sumOfTwoNumbers(5, 7); // Expected output: 12
Did you know?
The term "bug" was coined by Grace Hopper, a computer scientist, when she found a moth stuck in the Mark II computer.
Test Cases
Input:
1
Expected Output:
3