Beginner

The Sum of Two Numbers

Description

Your task is to create a reusable function that takes exactly two parameters and returns their sum.

  1. Input validation – The function should accept exactly two parameters and ensure they are numbers.
  2. Correct output – The function should return the sum of the two input values.
  3. 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: 20
sumOfTwoNumbers(5, 7); // Expected output: 12

window code 2Test Cases

Input:

1

Expected Output:

3