wip: add another question

chore/javascript
Arik Chakma 1 year ago
parent 6713b059e1
commit 7fb089259d
  1. 15
      src/data/question-groups/javascript/content/labelled-statements.md
  2. 5
      src/data/question-groups/javascript/javascript.md

@ -0,0 +1,15 @@
JavaScript label statements are used to prefix a label to an identifier. It can be used with `break` and `continue` statement to control the flow more precisely.
```js
loop1: for (let i = 0; i < 5; i++) {
if (i === 1) {
continue loop1; // skips the rest of the code in the loop1
}
console.log(`i: ${i}`);
}
// Output:
// i: 0
// i: 2
// i: 3
// i: 4
```

@ -231,4 +231,9 @@ questions:
topics:
- 'Core'
- 'Beginner'
- question: What are Labelled Statements in JavaScript?
answer: labelled-statements.md
topics:
- 'Core'
- 'Intermediate'
---

Loading…
Cancel
Save