0 of 8 problems solved • 0%
Use in a course

Exercise prompt

Read a Global Value

A variable declared outside every function and block has global scope in this program. Functions can read it when no closer variable has the same name.

Example

const courseName = "JavaScript"; function showCourse() { console.log(courseName); }

Your task

Complete showPrice so it reads the global currency and displays Price: 25 SEK. Keep the function reusable for other prices.