Javascript Challenges

Self Invoking Functions

I want to set variable 'testValue' to 3 using a Self Invoking Function, can you help me?

var testValue;
function test() { testValue = 3; }();

Exercise

Correct!
False!

What is the result of executing the previous code?

Exercise

Correct!
False!

What is the value of variable 'testValue'?

Exercise

Correct!
False!

Why?

Exercise

Correct!
False!

Write the code to execute this function adding only one more character to the sentence.

var testValue; function test() { testValue = 3; }();