Clean Variables
EasyAcc. 99.1%
+20 XP 5
Writing Neater Code
To keep scripts short, programmers often declare related variables all at once. By using a comma separator, you can make multiple variables under the same let or const statement.
The Assignment
Your job is to bundle two variable declarations.
- Declare two variables
aandbtogether on a single line using a singlelet. - Assign the passed
val1toaandval2tob. - Return the sum
a + b.
01EXAMPLE 1
Input
val1 = 5, val2 = 10Output
15Explanation: Variables declared together on one line.
Constraints
- Use a single let statement.
- Return the sum as a number.
FundamentalsVariables
JavaScriptSystem handles I/O — write your function only
Loading...
5 Hidden
Input Arguments
val15
val210
Expected Output
15
Click RUN to test your solution