Javascript colon (:) operator inside function

Viewed 79

I apologize if this question is stupid or duplicated, please point me to the right direction if so.

I've tested this code:

function b()
{
    a: 22;
    return a;
}

Code returns no error. Which leads me into thinking a: 20 inside function works. Though when call the function:

b();

..I receive "ReferenceError: a is not defined"

What does a: 22 inside function actually do? this.a inside function returns nothing so I don't think it has something to do with function as object (or it does?..)

1 Answers
Related