Skip to content

Instantly share code, notes, and snippets.

@shallaa
Created November 9, 2017 22:46
Show Gist options
  • Save shallaa/ac50b564b8851a54fe9ab74ee238d8fc to your computer and use it in GitHub Desktop.
Save shallaa/ac50b564b8851a54fe9ab74ee238d8fc to your computer and use it in GitHub Desktop.
for (const i of [1, 2, 3, 4]) {
if (i === 3) break;
log(i);
}
abc: {
log('a');
if (location.href.includes('.com')) break abc;
log('b');
let b = 4;
}
log('c');
k:{
let a = 3;
const f = () => {
let a = 5;
k:{
break k;
log(37);
}
log(a);
};
f();
}
let a = 3, b = 0;
switch (true) {
case a > 5 && a < 10: log('a', a); break;
case a > 4: log('b', a); break;
case a > 3: log('c', a); break;
case a > 2: log('d', a); break;
default:
}
a:const c = 3;
if (c === 1) {
} else {
if (c === 2) {
} else {
}
}
if (c > 5) {
} else switch (c) {
}
if (c > 5) {
} else for (;;) {
}
'', false, 0, undefined, null, NaN // falsy
for (; ; ) {
}
var a = act.method().c;
while(a) {
let r = other.action();
a = act.method().c;
if (r === 'abc') a = false;
}
do a++; while (a);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment