Codetive
Sign In
Coding challenges as of now are only available on desktop
On mobile you can try our quiz
Quiz
We are working hard to bring coding challenges with editor on mobile 💚

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:

  1. Write a function named sum that accepts two arguments (both numbers).
  2. 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
Browser
Console
Tests
Soon