Value Scaling

EasyAcc. 98.2%
+15 XP 5

Universal Magnification

Scale all data points by a multiplier.

The Assignment

Your function receives data and a scale factor.

  1. Iterate through the array.
  2. For each element, multiply it by scale.
  3. Print each Result on a new line.

01EXAMPLE 1

Inputdata=[1, 2], scale=10
Output10 20

Explanation: 110 and 210.

Constraints

  • One result per line.
ArraysLoops
JavaScript
Loading...
1 Hidden

Input Arguments

data[1,2]
scale10

Expected Output

10
20

Click RUN to test your solution