0
function abc(){
   a:'b'; 
   c:'f'; 
   f:'t'; 
};

This snippet does not throw an error in console. I want to understand whats happening with the variables inside the function. Hows it being interpreted by the javascript engine.

yogi
  • 19,175
  • 13
  • 62
  • 92
Devang Paliwal
  • 291
  • 2
  • 4

1 Answers1

6

Those are not variables, they are labels.

They can be used like this (example from How can I use goto in Javascript?):

LABEL1: do {
  x = x + 2;
  ...
  // JUMP TO THE END OF THE DO-WHILE - A FORWARDS GOTO
  if (x < 100) break LABEL1;
  // JUMP TO THE START OF THE DO WHILE - A BACKWARDS GOTO...
  if (x < 100) continue LABEL1;
} while(0);
Community
  • 1
  • 1
Femaref
  • 60,705
  • 7
  • 138
  • 176