Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d57b288

Browse files
Intervals and Timers
1 parent d176a2b commit d57b288

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

‎11_Classes_this_and_new_keyword/script.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
// console.log(user);
3333

34-
// HOw can we do the same thing above using
34+
// How can we do the same thing above using
3535
// arrow function ?
3636

3737
const createPerson = (name, age, isWorking) => ({ name, age, isWorking });

‎12_Asynchronous_Concepts/12.md‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#### Intervals and Timers
2+
3+
```js
4+
// Asynchronous Code
5+
6+
// setInterval
7+
// clearInterval
8+
9+
// outputs Hello, world! Every 2 seconds
10+
const myInterval = setInterval(() => console.log("Hello, world!"), 2000);
11+
clearInterval(myInterval); // Clears the Interval
12+
13+
// setTimeout
14+
// clearTimeout
15+
16+
// Outputs Let's Play after 5 seconds
17+
const myTimeout = setTimeout(() => console.log("Lets play"), 5000);
18+
19+
console.log("logging in the bottom");
20+
```
21+

‎12_Asynchronous_Concepts/script.js‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Asynchronous Code
2+
3+
// setInterval
4+
// clearInterval
5+
// const myInterval = setInterval(() => console.log("Hello, world!"), 2000);
6+
// clearInterval(myInterval);
7+
8+
// setTimeout
9+
// clearTimeout
10+
const myTimeout = setTimeout(() => console.log("Lets play"), 5000);
11+
12+
console.log("logging in the bottom");

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /