Correctly update global variable
We want to use the function func to update the global variable x. But when we run the code, the value of global x is not updated. Adjust the code so that the final value of global x is 2.
Premium
JavaScript
Console