...

/

Exercise: Enable an Image to Be Parameterized

Exercise: Enable an Image to Be Parameterized

Test yourself and implement what you have learned so far in this exercise.

We'll cover the following...
svg viewer

In the create-docker-images/exercises/jsparam/starter folder you’ll find a compute.js file with the following code:

Press + to interact
var radius = process.env.diameter / 2;
var area = Math.pow(radius, 2) * Math.PI;
console.log(
`Area of a ${radius} cm radius disk:
${area} cm²`
);

svg viewer

It’s a modified version of the code from the ...