When I was using the developer console in the browser, I accidentally entered a construction like whatewer:42
The console in response output a number after the colon. I don't understand why such a construction is needed. If you use it anywhere else, you get an error.
Asked
Active
Viewed 20 times
2
hheimerd
- 33
- 3
1 Answers
3
If you use it anywhere else, you get an error.
No, you don't. It's a labeled statement.
function test() {
whatever: 42;
console.log('No error');
}
test();
Robby Cornelissen
- 81,630
- 19
- 117
- 142