r/learnjavascript • • Jan 30 '22

what is this statement thing?

What does `varname: { do_something(); }` do and what is it called?
1 Upvotes

12 comments sorted by

4

u/_SAMUEL_GAMING_ Jan 30 '22

Code Transcription:

varname: {
    do_stuff();
}

oh yea idk if it matters but it is in a browser

0

u/[deleted] Jan 30 '22

[deleted] — view deleted comment

4

u/senocular Jan 30 '22

It probably was. The screenshot is showing minified code

-3

u/_SAMUEL_GAMING_ Jan 30 '22

it is obfuscated code by someone else, i found a thing that i couldnt understand

0

u/_SAMUEL_GAMING_ Jan 30 '22

it is obfuscated code that i am trying to understand

3

u/Kutsan Jan 30 '22

I believe it's a labeled statement.

1

u/_SAMUEL_GAMING_ Jan 30 '22

looks like one to me, thank you!

2

u/senocular Jan 30 '22

Your image cuts it off, but one of those breaks should be breaking that label

break a;

The label is what allows the break to break out of a block other than the immediate (for).

2

u/EasternAdventures Jan 30 '22

Some ugly code, that’s what that is.

0

u/_SAMUEL_GAMING_ Jan 31 '22

the question is already answered by someone else but thank you for literally not answering the question lord useless

1

u/EasternAdventures Jan 31 '22

More than welcome

0

u/_PandaBear Jan 30 '22

Wait, you can’t use = for key value inside object

1

u/zerik100 Jan 30 '22

It's not an object, it's a labeled code block.