The Type Alchemist

Easy+20 XP

Mission Briefing

The Kingdom's census data is corrupted; all citizen ages have been recorded as text instead of math-ready numbers. You need to act as an alchemist and convert them back.

The Concept: Type Conversion

Data types matter! You can't perform math on the string "50" the same way you can on the number 50. Use the Number() function to transform numeric strings into actual numbers.

The Objective

Your function receives a string val that contains numeric characters.

  1. Convert the val string into a proper Number type.
  2. Return the converted number.

01EXAMPLE 1

Inputval = "50"
Output50

Constraints

  • Result must be a Number type.
FundamentalsData Types
JavaScript
Loading...
3 Hidden

Input Arguments

val"50"

Expected Output

50

Click RUN to test your solution