Skip to content

Commit 6810657

Browse files
author
SatYu26
committed
initial commit
0 parents  commit 6810657

File tree

9 files changed

+190
-0
lines changed

9 files changed

+190
-0
lines changed

10th.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
function x() {
2+
var a=7;
3+
function y() {
4+
console.log(a);
5+
}
6+
return y;
7+
}
8+
var z = x();
9+
console.log(z);
10+
//..........
11+
z();
12+
13+
// function z() {
14+
// var b=900;
15+
// function x() {
16+
// var a=7;
17+
// function y() {
18+
// console.log(a, b);
19+
// }
20+
// y();
21+
// }
22+
// x();
23+
// }
24+
// z();

11th.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
function x() {
2+
3+
for(var i=1; i<=5; i++){
4+
5+
function close(x) {
6+
7+
setTimeout(function() {
8+
console.log(x);
9+
}, x*1000);
10+
}
11+
close(i);
12+
}
13+
14+
15+
for(let i=1; i<=5; i++){
16+
17+
setTimeout(function() {
18+
console.log(i);
19+
}, i*1000);
20+
21+
}
22+
23+
console.log("satyam");
24+
}
25+
x();
26+
27+
28+
29+
30+
// function x() {
31+
32+
// var i = 1;
33+
// setTimeout(function() {
34+
// console.log(i);
35+
// }, 3000);
36+
// console.log("satyam");
37+
// }
38+
// x();

13th.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// function statement
2+
3+
function statement() {
4+
console.log("a called");
5+
}
6+
statement();
7+
8+
// function expression a.k.a. function declaration
9+
10+
var b = function () {
11+
console.log("b called");
12+
}
13+
b();
14+
15+
// anonymous function
16+
17+
// function () {
18+
19+
// }
20+
21+
// Named Function Expression
22+
23+
var c = function Named() {
24+
console.log("Named Function Expression called");
25+
}
26+
c();
27+
// Named(); // Reference error in this line
28+
29+
// First Class Functions/Citizens
30+
31+
var d = function (param1) {
32+
console.log(param1);
33+
}
34+
35+
d(function () {});

14th.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// What is a Callback function in JavaScript
2+
3+
// setTimeout(function () {
4+
// console.log("timer");
5+
// }, 5000);
6+
7+
// function x(y) {
8+
// console.log("x");
9+
// y();
10+
// }
11+
12+
// x(function y() {
13+
// console.log("y");
14+
// });
15+
16+
function attachEventListners() {
17+
let count = 0;
18+
19+
document.getElementById("clickMe")
20+
.addEventListener("click", function xyz() {
21+
console.log("button clicked", ++count);
22+
});
23+
}
24+
25+
attachEventListners();
26+

4th.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
var x = 1;
3+
a();
4+
b();
5+
console.log(x);
6+
7+
function a() {
8+
var x = 10;
9+
console.log(x);
10+
}
11+
12+
function b() {
13+
var x = 100;
14+
console.log(x);
15+
}

6th.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
var a;
2+
console.log(a);
3+
4+
a =10;
5+
console.log(a);
6+
7+
a = "satyam";
8+
console.log(a);
9+
10+
// if(a===undefined) {
11+
// console.log("a is undefined");
12+
// }
13+
// else {
14+
// console.log("a is not undefined");
15+
// }

Readme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Introduction to JavaScript
2+
3+
This contains the learning path i followed in order to learn JavaScript through YouTube by Akshay Saini.
4+
5+
## YouTube Playlist: https://youtube.com/playlist?list=PLlasXeu85E9cQ32gLCvAvr9vNaUccPVNP

currying.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// let multiply = function (x, y) {
2+
// console.log(x*y);
3+
// }
4+
5+
// let multiplyTwo = multiply.bind(this, 2);
6+
// multiplyTwo(5);
7+
8+
let multiply = function (x) {
9+
return function (y) {
10+
console.log(x*y);
11+
}
12+
}
13+
14+
let multiplyTwo = multiply(2);
15+
multiplyTwo(6);

index.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html lang="en-US">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<title>Namaste Javascript</title>
8+
<script src="14th.js" defer></script>
9+
</head>
10+
11+
<body>
12+
<h1 id="heading">"Hello World"</h1>
13+
<button id="clickMe">click me</button>
14+
<!-- this button is added for episode number 14th -->
15+
</body>
16+
17+
</html>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy