Numeric Coercion

EasyAcc. 95.6%
+20 XP 5

Explicit Casting

Data from external sensors often arrives as strings. To perform arithmetic, you must explicitly cast them. The Unary Plus (+) is the most efficient way to achieve this.

  1. Cast stringA and stringB to numbers using +.
  2. Return their sum.

01EXAMPLE 1

InputstringA = "10", stringB = "5"
Output15

Explanation: String merge creates 105; casting creates 15.

Constraints

  • Use the + operator.
  • Return a number result.
FundamentalsMathTypes
JavaScript
Loading...
9 Hidden

Input Arguments

stringA"10"
stringB"5"

Expected Output

15

Click RUN to test your solution