Skip to content

Commit ad6ac8e

Browse files
committed
Regular Commit
1 parent 3d0078a commit ad6ac8e

File tree

7 files changed

+85
-0
lines changed

7 files changed

+85
-0
lines changed

101Basics/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Document</title>
8+
</head>
9+
<body>
10+
<h1>Suresh - Sandeep JS BrainStorming</h1>
11+
<script src="./index.js"></script>
12+
</body>
13+
</html>

101Basics/index.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// console.log(numb)
2+
var numb = 10;
3+
4+
// console.log(numb2)
5+
// let numb2 = 15;
6+
7+
print(numb);
8+
9+
const print = (number) => {
10+
console.log(number)
11+
}
12+
// TODO: ES6
13+
14+
print(numb);
15+
16+
console.log("Hello");
17+
18+
/**
19+
* variables are stored and assigned to "undefined";
20+
* e.g., variableName : undefined
21+
* functions are stored and assigned to its function definition.
22+
* e.g., functionName : functionDefinition
23+
*/

Closures/Demonstration/AppLayout.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// TODO: Closure Real World Example. (DONE)
2+
const AppLayout = (param) => {
3+
let outlet;
4+
switch (param) {
5+
case "home":
6+
outlet = "Home Page";
7+
break;
8+
case "about":
9+
outlet = "About Page";
10+
break;
11+
case "contact":
12+
outlet = "Contact Page";
13+
break;
14+
default:
15+
if(param) outlet = "404 NOT FOUND PAGE";
16+
break;
17+
}
18+
const Header = () => {
19+
console.log("App Header rendered...");
20+
}
21+
const Footer = () => {
22+
console.log("App Footer rendered...")
23+
}
24+
const Outlet = () =>{
25+
Header();
26+
outlet ? console.log(`${outlet} rendered...`) : console.log("Select the Page");
27+
Footer();
28+
}
29+
return Outlet;
30+
}
31+
32+
let App = AppLayout();
33+
App();
File renamed without changes.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Higher Order Function:
2+
-> A function which takes another function as an argument to itself, or return the function from itself is Higher Order Function.,
3+
-> The function which is passed into the Higher Order function is called call back function.
4+
5+
e.g., function x(){
6+
console.log("Namaste");
7+
}
8+
9+
function y(x){
10+
x();
11+
}
12+
13+
y(x)
14+
15+
=> y is a higher order function and,
16+
=> x is a call back function.

0 commit comments

Comments
 (0)