Help! Where Am I! Is particularly useful. This. bait and switch

Huh. Why on earth does this not throw a syntax error?
name_of_if: if(true){
alert(“Huh. you can name if statements.”);

I got he idea from Douglas Crockford’s statements railroad diagram.

Ahh. Labels are used by break and continue statements. They are evil. Do not use them. Have you ever been a volunteer doing work for an event, and you were in the middle of something, like, say, washing dishes, and a coordinator came up to you and said, “stop that! Go pick up trash.”. So you stopped doing doing dishes and went to pick up trash. Then another volunteer coordinator came up while you were in the middle od picking up trash and said “stop that! Go do dishes.”. That’s what break ans continute do. Usually they are used to interrupt your program when you are in the middle of something and send you off to a completely different part od the program to do something else.

It’s frustrating for volunteers, and it’s frustrating for coders trying to read your code-expecially when yiunare in the middle of something and it interrupts itself to do something completley different. Don’t do it.

It seems like javascript is trying to be three different critters. Assembler: (break, continue) Imperative (statements)
And functional (functions as first-class objects)

Wierd wierd labels Good question. No answer.

There are 9 statements, like a cat with nine lives.

Tri-force Loopy switch ex-wife very if Disease

If my ex-wife tries fruit-loops, switch her with the disco virgin. If expression try loops (do, while, for) switch disruptive var



Here’s a weird thing. Function invocations are expressions. F() is an expression
F(); is an expression statement.

Rule of thumb: a statement does something. An expression turns into a value.

In javascript, the two are blurred.

Sent from my iPad