Compare commits
6 Commits
c774c0be13
...
c38c66a446
Author | SHA1 | Date |
---|---|---|
jason.zhu | c38c66a446 | |
jason.zhu | c11b998681 | |
jason.zhu | cfc610bf1a | |
jason.zhu | bd562c63a2 | |
jason.zhu | 4f0a3819c4 | |
jason.zhu | cdbfc9f1a1 |
|
@ -0,0 +1,3 @@
|
||||||
|
# README
|
||||||
|
|
||||||
|
This is a practice repo following [JavaScript: Functions](https://app.pluralsight.com/course-player?clipId=bdda4158-f634-4866-ac1a-f536f948c3e1)
|
|
@ -0,0 +1,12 @@
|
||||||
|
function setupCounter(val) {
|
||||||
|
return function counter() {
|
||||||
|
return val++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let counter1 = setupCounter(0);
|
||||||
|
console.log(counter1());
|
||||||
|
console.log(counter1());
|
||||||
|
let counter2 = setupCounter(10);
|
||||||
|
console.log(counter2());
|
||||||
|
console.log(counter2());
|
|
@ -0,0 +1,14 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
|
<title>JavaScript Demo</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>JavaScript Demo</h1>
|
||||||
|
<script src="app.js"></script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
Loading…
Reference in New Issue