logo
logo

Variable Scope

Beginner

Variable Scope

Create a function
printNumbers
that logs to the console the numbers from 1 to a given number
n
, and also logs the value of a variable
count
that keeps track of the number of times the function has been called. The variable
count
should only be accessible inside the
printNumbers
function and should be initialized to 0 every time the function is called.
Console
Submit
Solution
00:00