AscalifyCodeLibs
Back to JavaScriptJavaScript → FunctionsQuestion 1 of 4
Add Two Numbers
Functions
Write a function `add(a, b)` that returns the sum of two numbers. Call it with the given values and print the result.
Example 1:
Input: a = 4, b = 9
Output: 13
Explanation: 4 + 9 = 13.
Example 2:
Input: a = 0, b = 5
Output: 5
Example 3:
Input: a = -2, b = 7
Output: 5
Code
Testcase / Output
Default testcase
a = 4, b = 9
Expected output
13
Returned results
Click Run to execute your code against the testcase.