Re:Use labels to break ifs in JavaScript
by cdumler on Wednesday August 07, 2013 @10:49AM
(#6173195)
The reason to use it when you have a lot of conditional behavior tied to processing that can stop a process. With traditional code you have really two choices: highly-nested conditionals (or lots of utility subroutines) or using thrown errors for process control (which isn't their purpose). With labels, you're using process control for process control. In my experience, labels generally come into play for data processing, where often the desired behavior is not known until substantial decoding occurs. For made-up instance:
[ Parent
| on HN ]
There are no comments on this comment yet.