Variable Declaration & Sum
Easy+10 XP
Mission Briefing
The Royal Mathematicians are attempting to calibrate the portal engine, but their manual calculations are too slow. They need an automated mechanism to fuse data points together.
The Concept: Data Storage
In JavaScript, a variable is a designated container in memory used to store data safely. We create variables using the let keyword for data that might change, or const for data that is permanent.
The Objective
Your function receives two numeric parameters, num1 and num2.
- Declare a new variable named
total. - Assign it the result of mathematically adding
num1andnum2. - Return your
totalvariable to complete the calibration.
01EXAMPLE 1
Input
num1 = 15, num2 = 25Output
40Explanation: 15 + 25 = 40
02EXAMPLE 2
Input
num1 = -5, num2 = 10Output
5Explanation: -5 + 10 = 5
Constraints
- Return the sum of the two parameters.
- The return value must be a Number.
FundamentalsVariablesArithmetic
JavaScriptSystem handles I/O — write your function only
Loading...
3 Hidden
Input Arguments
num115
num225
Expected Output
40
Click RUN to test your solution