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.

  1. Declare two variables a and b together on a single line using a single let.
  2. Assign the passed val1 to a and val2 to b.
  3. Return the sum a + b.

01EXAMPLE 1

Inputval1 = 5, val2 = 10
Output15

Explanation: Variables declared together on one line.

Constraints

  • Use a single let statement.
  • Return the sum as a number.
FundamentalsVariables
JavaScript
Loading...
5 Hidden

Input Arguments

val15
val210

Expected Output

15

Click RUN to test your solution