From fde20bafbae29c5b77413bc0551058e3d74ec0de Mon Sep 17 00:00:00 2001
From: SUMAN_SINGH-SDE-1 <suman.singh@softsages.com>
Date: Fri, 12 Jan 2024 18:42:44 +0530
Subject: [PATCH 01/29] javascript topics function scope chain

---
 Let&ConstTempoZone.js |  2 ++
 funtions.js           | 14 +++++++++
 index.html            | 72 +++++++++++++++++++++++++++++++++++++++++++
 scopeChain.js         | 10 ++++++
 script.js             | 11 +++++++
 style.css             | 56 +++++++++++++++++++++++++++++++++
 6 files changed, 165 insertions(+)
 create mode 100644 Let&ConstTempoZone.js
 create mode 100644 funtions.js
 create mode 100644 index.html
 create mode 100644 scopeChain.js
 create mode 100644 script.js
 create mode 100644 style.css

diff --git a/Let&ConstTempoZone.js b/Let&ConstTempoZone.js
new file mode 100644
index 0000000..d15b3c0
--- /dev/null
+++ b/Let&ConstTempoZone.js
@@ -0,0 +1,2 @@
+let a = 10;
+var b = 100;
\ No newline at end of file
diff --git a/funtions.js b/funtions.js
new file mode 100644
index 0000000..798aa65
--- /dev/null
+++ b/funtions.js
@@ -0,0 +1,14 @@
+var acc = 1;
+a();
+b();
+console.log(acc);
+function a() {
+    const acc = 10;
+    console.log(acc);
+    console.log(bb);
+    const bb = 22;
+}
+function b() {
+    const acc = 100;
+    console.log(acc);
+}
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..93bf234
--- /dev/null
+++ b/index.html
@@ -0,0 +1,72 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <title>JavaScript Topics</title>
+    <!-- <script src="./script.js" defer></script> -->
+    <!-- <script src="./funtions.js" defer></script> -->
+    <!-- <script src="./scopeChain.js"></script> -->
+    <script src="./Let&ConstTempoZone.js"></script>
+    <link rel="stylesheet" href="./style.css" />
+  </head>
+  <header>
+    <div class="container">
+      <h1>JavaScript Topics</h1>
+      <nav>
+        <ul>
+          <li><a href="#core-concepts">Core Concepts</a></li>
+          <li><a href="#advanced-concepts">Advanced Concepts</a></li>
+          <li><a href="#additional-topics">Additional Topics</a></li>
+        </ul>
+      </nav>
+    </div>
+  </header>
+  
+  <section id="core-concepts" class="topic-list">
+    <div class="container">
+      <h2>Core Concepts</h2>
+      <ul>
+        <li>Variables and Data Types</li>
+        <li>Functions</li>
+        <li>Objects</li>
+        <li>Arrays</li>
+        <li>Conditional Statements</li>
+        <li>Loops</li>
+      </ul>
+    </div>
+  </section>
+  
+  <section id="advanced-concepts" class="topic-list">
+    <div class="container">
+      <h2>Advanced Concepts</h2>
+      <ul>
+        <li>Scope and Closures</li>
+        <li>Hoisting</li>
+        <li>Callback Functions</li>
+        <li>Promises</li>
+        <li>Async/Await</li>
+        <li>Event Handling</li>
+      </ul>
+    </div>
+  </section>
+
+  <section id="additional-topics" class="topic-list">
+    <div class="container">
+      <h2>Additional Topics</h2>
+      <ul>
+        <li>DOM Manipulation</li>
+        <li>HTTP Requests (AJAX)</li>
+        <li>Local Storage</li>
+        <li>ES6+ Features</li>
+      </ul>
+    </div>
+  </section>
+
+  <footer>
+    <div class="container">
+      <p>&copy; 2024 JavaScript Topics</p>
+    </div>
+  </footer>
+</body>
+</html>
\ No newline at end of file
diff --git a/scopeChain.js b/scopeChain.js
new file mode 100644
index 0000000..dd5dd23
--- /dev/null
+++ b/scopeChain.js
@@ -0,0 +1,10 @@
+
+
+function a() {
+    var b = 10;
+    c();
+    function c() {
+        console.log(b);
+    }
+}
+a();
\ No newline at end of file
diff --git a/script.js b/script.js
new file mode 100644
index 0000000..6fce8eb
--- /dev/null
+++ b/script.js
@@ -0,0 +1,11 @@
+
+
+var x = 7;
+
+function getName() {
+    console.log("Hello js");
+}
+
+getName();
+console.log(x);
+console.log(getName);
\ No newline at end of file
diff --git a/style.css b/style.css
new file mode 100644
index 0000000..3a1cfce
--- /dev/null
+++ b/style.css
@@ -0,0 +1,56 @@
+body {
+    font-family: 'Arial', sans-serif;
+    margin: 0;
+    padding: 0;
+    background-color: #f9f9f9;
+    color: #333;
+  }
+  
+  .container {
+    width: 80%;
+    margin: 0 auto;
+  }
+  
+  header {
+    background-color: #3498db;
+    color: #fff;
+    text-align: center;
+    padding: 1em 0;
+  }
+  
+  h1, h2 {
+    color: #3498db;
+  }
+  
+  .topic-list {
+    margin: 20px 0;
+    padding: 20px 0;
+    background-color: #fff;
+    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
+    border-radius: 8px;
+  }
+  
+  ul {
+    list-style-type: none;
+    padding: 0;
+  }
+  
+  li {
+    padding: 10px 0;
+    border-bottom: 1px solid #eee;
+  }
+  
+  li:last-child {
+    border-bottom: none;
+  }
+  
+  footer {
+    background-color: #3498db;
+    color: #fff;
+    text-align: center;
+    padding: 1em 0;
+    position: fixed;
+    bottom: 0;
+    width: 100%;
+  }
+  
\ No newline at end of file

From 690aafc015d1cc7e3262d0b3514a80bf3298aeec Mon Sep 17 00:00:00 2001
From: SUMAN_SINGH-SDE-1 <suman.singh@softsages.com>
Date: Fri, 12 Jan 2024 19:06:48 +0530
Subject: [PATCH 02/29] temporal deadZone

---
 Let&ConstTempoZone.js | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/Let&ConstTempoZone.js b/Let&ConstTempoZone.js
index d15b3c0..aab8e5c 100644
--- a/Let&ConstTempoZone.js
+++ b/Let&ConstTempoZone.js
@@ -1,2 +1,19 @@
+
+/*Temporal Dead Zone (TDZ):
+let and const have block scope:
+Unlike var, which is function-scoped or globally scoped, let and const are
+ block-scoped. This means they are only accessible within the block, statement, or expression where they are declared.
+Temporal Dead Zone (TDZ):
+When you use let and const, the variables are hoisted to the top of
+ their block, but they remain uninitialized until the actual declaration is 
+ reached in the code. Accessing the variable before the declaration results in a ReferenceError.
+This time between the start of the block and the actual declaration 
+is called the "Temporal Dead Zone" (TDZ). During this period, 
+any attempt to access the variable leads to an error.
+When we try to access the value which we declare with let and const 
+ it hoisted to thor local memory area when we access it so the time when  between initialized undefine to value called temporal dead zone*/
+
+
+console.log(b);
 let a = 10;
 var b = 100;
\ No newline at end of file

From d96a91be393f05dfd41c5b90eb6de45b96ef627f Mon Sep 17 00:00:00 2001
From: SUMAN_SINGH-SDE-1 <suman.singh@softsages.com>
Date: Thu, 18 Jan 2024 18:58:54 +0530
Subject: [PATCH 03/29] block scope and shadowing

---
 BlockScope.js | 32 ++++++++++++++++++++++++++++++++
 index.html    |  3 ++-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 BlockScope.js

diff --git a/BlockScope.js b/BlockScope.js
new file mode 100644
index 0000000..887743c
--- /dev/null
+++ b/BlockScope.js
@@ -0,0 +1,32 @@
+// {
+
+
+
+//     var a = 10;
+//     let b = 20;
+//     const c = 30;
+//     console.log(a);
+//     console.log(b);
+//     console.log(c);
+// }
+
+
+// console.log(a);
+// console.log(b);
+// console.log(c);
+
+// Shadowing 
+var a = 100;
+{
+
+
+
+    var a = 10;
+    let b = 20;
+    const c = 30;
+    console.log(a); 10
+    console.log(b); 20
+    console.log(c); 30
+}
+console.log(a); 10
+
diff --git a/index.html b/index.html
index 93bf234..c7db539 100644
--- a/index.html
+++ b/index.html
@@ -7,7 +7,8 @@
     <!-- <script src="./script.js" defer></script> -->
     <!-- <script src="./funtions.js" defer></script> -->
     <!-- <script src="./scopeChain.js"></script> -->
-    <script src="./Let&ConstTempoZone.js"></script>
+    <!-- <script src="./Let&ConstTempoZone.js"></script> -->
+        <script src="./BlockScope.js"></script>
     <link rel="stylesheet" href="./style.css" />
   </head>
   <header>

From f466c5c568a4545c5239f7583a3055025638ef6f Mon Sep 17 00:00:00 2001
From: SUMAN_SINGH-SDE-1 <suman.singh@softsages.com>
Date: Fri, 19 Jan 2024 11:20:27 +0530
Subject: [PATCH 04/29] block scope and shadowing

---
 BlockScope.js | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/BlockScope.js b/BlockScope.js
index 887743c..849be44 100644
--- a/BlockScope.js
+++ b/BlockScope.js
@@ -16,7 +16,8 @@
 // console.log(c);
 
 // Shadowing 
-var a = 100;
+// var a = 100;
+let b = 200;
 {
 
 
@@ -24,9 +25,9 @@ var a = 100;
     var a = 10;
     let b = 20;
     const c = 30;
-    console.log(a); 10
-    console.log(b); 20
-    console.log(c); 30
+    console.log(a);
+    console.log(b);
+    console.log(c);
 }
-console.log(a); 10
+console.log(b);
 

From e177a6c9fd43e47576b29fa73a6ee0d65f18d652 Mon Sep 17 00:00:00 2001
From: SUMAN_SINGH-SDE-1 <suman.singh@softsages.com>
Date: Mon, 22 Jan 2024 17:32:38 +0530
Subject: [PATCH 05/29] closure

---
 Closures .js | 13 +++++++++++++
 index.html   |  3 ++-
 2 files changed, 15 insertions(+), 1 deletion(-)
 create mode 100644 Closures .js

diff --git a/Closures .js b/Closures .js
new file mode 100644
index 0000000..b917486
--- /dev/null
+++ b/Closures .js	
@@ -0,0 +1,13 @@
+function z() {
+    var b = 100;
+    function x() {
+        var a = 7;
+        function y() {
+            console.log(a, b);
+        }
+        y()
+    }
+    x()
+}
+
+z()
\ No newline at end of file
diff --git a/index.html b/index.html
index c7db539..0803dca 100644
--- a/index.html
+++ b/index.html
@@ -8,7 +8,8 @@
     <!-- <script src="./funtions.js" defer></script> -->
     <!-- <script src="./scopeChain.js"></script> -->
     <!-- <script src="./Let&ConstTempoZone.js"></script> -->
-        <script src="./BlockScope.js"></script>
+        <!-- <script src="./BlockScope.js"></script> -->
+        <script src="./Closures .js"></script>
     <link rel="stylesheet" href="./style.css" />
   </head>
   <header>

From 45ca901d2f424cecdefbeaa407432f321203b546 Mon Sep 17 00:00:00 2001
From: SUMAN_SINGH-SDE-1 <suman.singh@softsages.com>
Date: Tue, 23 Jan 2024 18:23:40 +0530
Subject: [PATCH 06/29] closure

---
 .vscode/settings.json |  3 +++
 SetTimeOutclosure.js  | 24 ++++++++++++++++++++++++
 index.html            |  5 ++++-
 3 files changed, 31 insertions(+), 1 deletion(-)
 create mode 100644 .vscode/settings.json
 create mode 100644 SetTimeOutclosure.js

diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..d97764d
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,3 @@
+{
+  "cSpell.words": ["Namaste"]
+}
diff --git a/SetTimeOutclosure.js b/SetTimeOutclosure.js
new file mode 100644
index 0000000..e96464b
--- /dev/null
+++ b/SetTimeOutclosure.js
@@ -0,0 +1,24 @@
+// function x() {
+//     for (let i = 1; i <= 5; i++) {
+//         setTimeout(function () {
+//             console.log(i);
+//         }, i * 1000);
+//     }
+
+//     console.log("Namaste  JS");
+// }
+// x();
+
+function x() {
+    for (var i = 1; i <= 5; i++) {
+        function close(x) {
+            setTimeout(function () {
+                console.log(x);
+            }, x * 1000);
+        }
+        close(i);
+    }
+
+    console.log("Namaste  JS");
+}
+x();
diff --git a/index.html b/index.html
index 0803dca..00e41b1 100644
--- a/index.html
+++ b/index.html
@@ -9,8 +9,11 @@
     <!-- <script src="./scopeChain.js"></script> -->
     <!-- <script src="./Let&ConstTempoZone.js"></script> -->
         <!-- <script src="./BlockScope.js"></script> -->
-        <script src="./Closures .js"></script>
+        <!-- <script src="./Closures .js"></script> -->
+  <script src="./SetTimeOutclosure.js"></script>
+
     <link rel="stylesheet" href="./style.css" />
+
   </head>
   <header>
     <div class="container">

From e89a823a5aacff02f72f6a0b0e592dfeb8603102 Mon Sep 17 00:00:00 2001
From: SUMAN_SINGH-SDE-1 <suman.singh@softsages.com>
Date: Tue, 23 Jan 2024 18:44:54 +0530
Subject: [PATCH 07/29] closure

---
 ClosureQuestion.js | 13 +++++++++++++
 index.html         |  4 ++--
 2 files changed, 15 insertions(+), 2 deletions(-)
 create mode 100644 ClosureQuestion.js

diff --git a/ClosureQuestion.js b/ClosureQuestion.js
new file mode 100644
index 0000000..ded4023
--- /dev/null
+++ b/ClosureQuestion.js
@@ -0,0 +1,13 @@
+function outset() {
+    var c = 20;
+    function outer(b) {
+        function inner() {
+            console.log(a, b, c);
+        }
+        return inner;
+    }
+    return outer;
+}
+let a = 100;
+var close = outset()("hello world");
+close()
diff --git a/index.html b/index.html
index 00e41b1..25c8bd8 100644
--- a/index.html
+++ b/index.html
@@ -10,8 +10,8 @@
     <!-- <script src="./Let&ConstTempoZone.js"></script> -->
         <!-- <script src="./BlockScope.js"></script> -->
         <!-- <script src="./Closures .js"></script> -->
-  <script src="./SetTimeOutclosure.js"></script>
-
+  <!-- <script src="./SetTimeOutclosure.js"></script> -->
+ <script src="./ClosureQuestion.js"></script>
     <link rel="stylesheet" href="./style.css" />
 
   </head>

From a02badafbcce18c56c22f36169eceab333558b94 Mon Sep 17 00:00:00 2001
From: SUMAN_SINGH-SDE-1 <suman.singh@softsages.com>
Date: Mon, 29 Jan 2024 19:10:17 +0530
Subject: [PATCH 08/29] First class functions

---
 FirstClassFunction.js | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 FirstClassFunction.js

diff --git a/FirstClassFunction.js b/FirstClassFunction.js
new file mode 100644
index 0000000..1e20422
--- /dev/null
+++ b/FirstClassFunction.js
@@ -0,0 +1,25 @@
+
+// Function Statement   aka function declaration
+
+function funStateMent() {
+    console.log("this is function statement");
+}
+
+// Function Expression
+var fun = function () {
+
+}
+
+    //anonymous declaration
+    (function () {
+
+    })
+
+
+// named Function Expression
+var fun1 = function cc() {
+
+}
+
+
+

From 952b528a85936495043b7b65e0a55c1a44eccfa4 Mon Sep 17 00:00:00 2001
From: SUMAN_SINGH-SDE-1 <suman.singh@softsages.com>
Date: Wed, 31 Jan 2024 15:06:41 +0530
Subject: [PATCH 09/29] event listeners

---
 Arrays/tempCodeRunnerFile.js |  1 +
 callBackfunction.js          | 31 +++++++++++++++++++++++++++++++
 index.html                   |  5 ++++-
 3 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 Arrays/tempCodeRunnerFile.js
 create mode 100644 callBackfunction.js

diff --git a/Arrays/tempCodeRunnerFile.js b/Arrays/tempCodeRunnerFile.js
new file mode 100644
index 0000000..b26628a
--- /dev/null
+++ b/Arrays/tempCodeRunnerFile.js
@@ -0,0 +1 @@
+currentSum
\ No newline at end of file
diff --git a/callBackfunction.js b/callBackfunction.js
new file mode 100644
index 0000000..b7258e9
--- /dev/null
+++ b/callBackfunction.js
@@ -0,0 +1,31 @@
+// setTimeout(function () {
+//     console.log("timer");
+// }, 5000);
+
+// function x(y) {
+//     console.log("x");
+//     y();
+// }
+// x(function () {
+//     console.log("y");
+// });
+
+
+function clickHandler(event) {
+    console.log("button clicked", clickHandler.count++);
+}
+
+function attachEventListener() {
+    clickHandler.count = 1; // Initialize count as a property of the function
+    document.addEventListener("click", clickHandler);
+}
+
+function removeEventListener() {
+    document.removeEventListener("click", clickHandler);
+}
+
+attachEventListener();
+// To remove the event listener, call removeEventListener()
+// removeEventListener();
+
+
diff --git a/index.html b/index.html
index 25c8bd8..e0f2aac 100644
--- a/index.html
+++ b/index.html
@@ -11,13 +11,16 @@
         <!-- <script src="./BlockScope.js"></script> -->
         <!-- <script src="./Closures .js"></script> -->
   <!-- <script src="./SetTimeOutclosure.js"></script> -->
- <script src="./ClosureQuestion.js"></script>
+ <!-- <script src="./ClosureQuestion.js"></script> -->
+ <script src="./callBackfunction.js"></script>
     <link rel="stylesheet" href="./style.css" />
 
   </head>
   <header>
     <div class="container">
       <h1>JavaScript Topics</h1>
+      <button id="clickMe">Click Me</button>
+
       <nav>
         <ul>
           <li><a href="#core-concepts">Core Concepts</a></li>

From 2b6a6d7aba8572376681f2e2c2dece1cd9e102a5 Mon Sep 17 00:00:00 2001
From: SUMAN_SINGH-SDE-1 <suman.singh@softsages.com>
Date: Fri, 2 Feb 2024 12:40:40 +0530
Subject: [PATCH 10/29] higher order circle

---
 higherOrderFunction.js | 57 ++++++++++++++++++++++++++++++++++++++++++
 index.html             |  3 ++-
 tempCodeRunnerFile.js  |  1 +
 3 files changed, 60 insertions(+), 1 deletion(-)
 create mode 100644 higherOrderFunction.js
 create mode 100644 tempCodeRunnerFile.js

diff --git a/higherOrderFunction.js b/higherOrderFunction.js
new file mode 100644
index 0000000..606e5ca
--- /dev/null
+++ b/higherOrderFunction.js
@@ -0,0 +1,57 @@
+const listRadiuses = [2, 6, 7, 8, 3, 9];
+
+// without higher order functions
+const calculateArea = function (radiuses) {
+    const output = [];
+    for (const radius of radiuses) {
+        output.push(Math.PI * radius * radius);
+    }
+    return output;
+};
+
+console.log("Area of circle ", calculateArea(listRadiuses));
+
+const calculateCircumference = function (radiuses) {
+    const output = [];
+    for (const radius of radiuses) {
+        output.push(2 * Math.PI * radius);
+    }
+    return output;
+};
+
+console.log("Area of circumference ", calculateCircumference(listRadiuses));
+
+const calculateDiameter = function (radiuses) {
+    const output = [];
+    for (const radius of radiuses) {
+        output.push(2 * radius);
+    }
+    return output;
+};
+
+console.log("Area of Diameter ", calculateDiameter(listRadiuses));
+
+// with higher order function
+const area = function (radius) {
+    return Math.PI * radius * radius;
+};
+
+const circumference = function (radius) {
+    return 2 * Math.PI * radius;
+};
+const diameter = function (radius) {
+    return 2 * radius;
+};
+
+const calculate = function (radiuses, logic) {
+    const output = [];
+    for (const radius of radiuses) {
+        output.push(logic(radius));
+    }
+    return output;
+};
+
+
+console.log("calculate area", calculate(listRadiuses, area));
+console.log("calculate circumference", calculate(listRadiuses, circumference));
+console.log("calculate diameter", calculate(listRadiuses, diameter));
\ No newline at end of file
diff --git a/index.html b/index.html
index e0f2aac..6e6d06b 100644
--- a/index.html
+++ b/index.html
@@ -12,7 +12,8 @@
         <!-- <script src="./Closures .js"></script> -->
   <!-- <script src="./SetTimeOutclosure.js"></script> -->
  <!-- <script src="./ClosureQuestion.js"></script> -->
- <script src="./callBackfunction.js"></script>
+ <!-- <script src="./callBackfunction.js"></script> -->
+ <script src="./higherOrderFunction.js"></script>
     <link rel="stylesheet" href="./style.css" />
 
   </head>
diff --git a/tempCodeRunnerFile.js b/tempCodeRunnerFile.js
new file mode 100644
index 0000000..51de09c
--- /dev/null
+++ b/tempCodeRunnerFile.js
@@ -0,0 +1 @@
+const calculateCircumference = function (radius) {

From 5adf8ee2353652171ee75cc9a239cb245197941e Mon Sep 17 00:00:00 2001
From: SUMAN_SINGH-SDE-1 <suman.singh@softsages.com>
Date: Fri, 2 Feb 2024 13:09:03 +0530
Subject: [PATCH 11/29] map function

---
 Map.js | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 Map.js

diff --git a/Map.js b/Map.js
new file mode 100644
index 0000000..82c8825
--- /dev/null
+++ b/Map.js
@@ -0,0 +1,14 @@
+
+/* The map function is used to transform each element of an array into a new element, based on a given 
+transformation function.
+// It creates a new array with the same length as the original array, where each element is the 
+result of applying the transformation function to the corresponding element of the original array.*/
+
+const arr = [2, 3, 4, 5, 6];
+
+function double(x) {
+    return x * 2;
+}
+
+const output = arr.map(double);
+console.log("output", output);

From 9dde730107ed40ec0573d448c66ca28a4dfd801d Mon Sep 17 00:00:00 2001
From: SUMAN_SINGH-SDE-1 <suman.singh@softsages.com>
Date: Fri, 2 Feb 2024 13:10:48 +0530
Subject: [PATCH 12/29] filter  function

---
 Filter.js | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 Filter.js

diff --git a/Filter.js b/Filter.js
new file mode 100644
index 0000000..544abc5
--- /dev/null
+++ b/Filter.js
@@ -0,0 +1,10 @@
+
+
+const arr = [-1, 2, -6, 0, 3, 4, 5, 6];
+
+function double(x) {
+    return x > 0;
+}
+
+const output = arr.filter(double);
+console.log("output", output);
\ No newline at end of file

From c33dbf26b2a91a86c58e8dedcb59014be3a265ed Mon Sep 17 00:00:00 2001
From: SUMAN_SINGH-SDE-1 <suman.singh@softsages.com>
Date: Fri, 2 Feb 2024 13:11:37 +0530
Subject: [PATCH 13/29] filter  function

---
 Filter.js | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Filter.js b/Filter.js
index 544abc5..d9b2e4a 100644
--- a/Filter.js
+++ b/Filter.js
@@ -1,5 +1,8 @@
 
 
+// The filter function is used to create a new array containing only the elements of the original array that
+//  satisfy a given condition.
+
 const arr = [-1, 2, -6, 0, 3, 4, 5, 6];
 
 function double(x) {

From e90a419a919a5bc37d8ceddefd4d78ee4b744cfe Mon Sep 17 00:00:00 2001
From: SUMAN_SINGH-SDE-1 <suman.singh@softsages.com>
Date: Fri, 2 Feb 2024 13:12:35 +0530
Subject: [PATCH 14/29] filter  function

---
 Filter.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Filter.js b/Filter.js
index d9b2e4a..9e4d759 100644
--- a/Filter.js
+++ b/Filter.js
@@ -5,9 +5,9 @@
 
 const arr = [-1, 2, -6, 0, 3, 4, 5, 6];
 
-function double(x) {
-    return x > 0;
+function isOdd(x) {
+    return x % 2 == 0;
 }
 
-const output = arr.filter(double);
+const output = arr.filter(isOdd);
 console.log("output", output);
\ No newline at end of file

From 91ee7f6e7693bb1946be01f2c60e736eb7b0c4cf Mon Sep 17 00:00:00 2001
From: SUMAN_SINGH-SDE-1 <suman.singh@softsages.com>
Date: Fri, 2 Feb 2024 13:53:42 +0530
Subject: [PATCH 15/29] reduce

---
 Reduce.js | 9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100644 Reduce.js

diff --git a/Reduce.js b/Reduce.js
new file mode 100644
index 0000000..8601c2f
--- /dev/null
+++ b/Reduce.js
@@ -0,0 +1,9 @@
+const arr = [1, 2, 3, 4, 5];
+
+const output = arr.reduce(function (acc, curr) {
+    return acc += curr
+}, 0)
+
+
+
+console.log(output);
\ No newline at end of file

From 11acdea32ea4bc8db2acda62860ffc375f728860 Mon Sep 17 00:00:00 2001
From: SUMAN_SINGH-SDE-1 <suman.singh@softsages.com>
Date: Fri, 2 Feb 2024 15:39:21 +0530
Subject: [PATCH 16/29] call back hell

---
 callbackHell.js | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 callbackHell.js

diff --git a/callbackHell.js b/callbackHell.js
new file mode 100644
index 0000000..d442806
--- /dev/null
+++ b/callbackHell.js
@@ -0,0 +1,31 @@
+const cart = ["shoes", "pants", "Kurta"];
+
+api.createOrder(cart, function () {
+    api.proceedToPayment(function () {
+        api.showOrderSummary(function () {
+            api.updateWallet(function () {
+                api.applyDiscount(function () {
+                    api.verifyPayment(function () {
+                        api.sendConfirmationEmail(function () {
+                            api.notifyShipping(function () {
+                                api.trackOrder(function () {
+                                    api.showThankYouPage(function () {
+                                        api.requestFeedback(function () {
+                                            api.showSurvey(function () {
+                                                api.updateCustomerProfile(function () {
+                                                    api.logAnalytics(function () {
+                                                        console.log("All operations completed!");
+                                                    });
+                                                });
+                                            });
+                                        });
+                                    });
+                                });
+                            });
+                        });
+                    });
+                });
+            });
+        });
+    });
+});

From 2647adfafd83e5b9ac0fe0cab23120706ba82508 Mon Sep 17 00:00:00 2001
From: SUMAN_SINGH-SDE-1 <suman.singh@softsages.com>
Date: Fri, 2 Feb 2024 15:50:50 +0530
Subject: [PATCH 17/29] call back hell

---
 callbackHell.js | 50 +++++++++++++++++++++++++++++++++++--------------
 index.html      |  4 +++-
 2 files changed, 39 insertions(+), 15 deletions(-)

diff --git a/callbackHell.js b/callbackHell.js
index d442806..0df06fb 100644
--- a/callbackHell.js
+++ b/callbackHell.js
@@ -1,19 +1,41 @@
 const cart = ["shoes", "pants", "Kurta"];
 
-api.createOrder(cart, function () {
-    api.proceedToPayment(function () {
-        api.showOrderSummary(function () {
-            api.updateWallet(function () {
-                api.applyDiscount(function () {
-                    api.verifyPayment(function () {
-                        api.sendConfirmationEmail(function () {
-                            api.notifyShipping(function () {
-                                api.trackOrder(function () {
-                                    api.showThankYouPage(function () {
-                                        api.requestFeedback(function () {
-                                            api.showSurvey(function () {
-                                                api.updateCustomerProfile(function () {
-                                                    api.logAnalytics(function () {
+// Function to simulate API calls with the same function names
+function apiOperation(data, callback) {
+    setTimeout(function () {
+        // Simulating API response
+        callback();
+    }, 1000 * 5); // Delayed by 1 second for demonstration
+}
+
+apiOperation(cart, function createOrder() {
+    console.log("Order created");
+    apiOperation(null, function proceedToPayment() {
+        console.log("Proceeded to payment");
+        apiOperation(null, function showOrderSummary() {
+            console.log("Order summary displayed");
+            apiOperation(null, function updateWallet() {
+                console.log("Wallet updated");
+                apiOperation(null, function applyDiscount() {
+                    console.log("Discount applied");
+                    apiOperation(null, function verifyPayment() {
+                        console.log("Payment verified");
+                        apiOperation(null, function sendConfirmationEmail() {
+                            console.log("Confirmation email sent");
+                            apiOperation(null, function notifyShipping() {
+                                console.log("Shipping notified");
+                                apiOperation(null, function trackOrder() {
+                                    console.log("Order tracked");
+                                    apiOperation(null, function showThankYouPage() {
+                                        console.log("Thank you page shown");
+                                        apiOperation(null, function requestFeedback() {
+                                            console.log("Feedback requested");
+                                            apiOperation(null, function showSurvey() {
+                                                console.log("Survey shown");
+                                                apiOperation(null, function updateCustomerProfile() {
+                                                    console.log("Customer profile updated");
+                                                    apiOperation(null, function logAnalytics() {
+                                                        console.log("Analytics logged");
                                                         console.log("All operations completed!");
                                                     });
                                                 });
diff --git a/index.html b/index.html
index 6e6d06b..e545426 100644
--- a/index.html
+++ b/index.html
@@ -13,7 +13,9 @@
   <!-- <script src="./SetTimeOutclosure.js"></script> -->
  <!-- <script src="./ClosureQuestion.js"></script> -->
  <!-- <script src="./callBackfunction.js"></script> -->
- <script src="./higherOrderFunction.js"></script>
+ <!-- <script src="./higherOrderFunction.js"></script> -->
+ <script src="./callbackHell.js"></script>
+
     <link rel="stylesheet" href="./style.css" />
 
   </head>

From 708df9d5c0556c73ce9ddd5ca64cc96dbd25a116 Mon Sep 17 00:00:00 2001
From: SUMAN_SINGH-SDE-1 <suman.singh@softsages.com>
Date: Fri, 2 Feb 2024 17:17:05 +0530
Subject: [PATCH 18/29] call back hell

---
 Promise.js | 11 +++++++++++
 index.html |  6 ++++--
 2 files changed, 15 insertions(+), 2 deletions(-)
 create mode 100644 Promise.js

diff --git a/Promise.js b/Promise.js
new file mode 100644
index 0000000..fd564dd
--- /dev/null
+++ b/Promise.js
@@ -0,0 +1,11 @@
+
+
+const GITHUB_API = 'https://api.github.com/users/sumansingh226';
+
+const user = fetch(GITHUB_API);
+console.log(user);
+
+
+user.then(function (data) {
+    console.log(data);
+})
diff --git a/index.html b/index.html
index e545426..8198a43 100644
--- a/index.html
+++ b/index.html
@@ -14,7 +14,9 @@
  <!-- <script src="./ClosureQuestion.js"></script> -->
  <!-- <script src="./callBackfunction.js"></script> -->
  <!-- <script src="./higherOrderFunction.js"></script> -->
- <script src="./callbackHell.js"></script>
+ <!-- <script src="./callbackHell.js"></script> -->
+
+ <script src="./Promise.js"></script>
 
     <link rel="stylesheet" href="./style.css" />
 
@@ -23,7 +25,7 @@
     <div class="container">
       <h1>JavaScript Topics</h1>
       <button id="clickMe">Click Me</button>
-
+               
       <nav>
         <ul>
           <li><a href="#core-concepts">Core Concepts</a></li>

From 81e710e434c82f1b56e136643d7fdbee0e5918f4 Mon Sep 17 00:00:00 2001
From: SUMAN_SINGH-SDE-1 <suman.singh@softsages.com>
Date: Fri, 2 Feb 2024 17:20:26 +0530
Subject: [PATCH 19/29] call back hell

---
 index.html | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/index.html b/index.html
index 8198a43..e877c81 100644
--- a/index.html
+++ b/index.html
@@ -4,6 +4,11 @@
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
     <title>JavaScript Topics</title>
+    <link
+rel="stylesheet"
+href="https://static-exp1.licdn.com/sc/h/8fx9nkd7mx8avdpqm5hqcbi97"
+/>
+    <link rel="stylesheet" href="./style.css" />
     <!-- <script src="./script.js" defer></script> -->
     <!-- <script src="./funtions.js" defer></script> -->
     <!-- <script src="./scopeChain.js"></script> -->
@@ -17,21 +22,35 @@
  <!-- <script src="./callbackHell.js"></script> -->
 
  <script src="./Promise.js"></script>
+ <script
+ src="https://platform.linkedin.com/badges/js/profile.js"
+ async
+ defer
+ type="text/javascript"
+></script>
 
-    <link rel="stylesheet" href="./style.css" />
 
   </head>
   <header>
     <div class="container">
       <h1>JavaScript Topics</h1>
       <button id="clickMe">Click Me</button>
-               
+      <div
+      class="badge-base LI-profile-badge"
+      data-locale="en_US"
+      data-size="medium"
+      data-theme="dark"
+      data-type="VERTICAL"
+      data-vanity="suman-singh-6085741aa"
+      data-version="v1"
+    ></div>    
       <nav>
         <ul>
           <li><a href="#core-concepts">Core Concepts</a></li>
           <li><a href="#advanced-concepts">Advanced Concepts</a></li>
           <li><a href="#additional-topics">Additional Topics</a></li>
         </ul>
+       
       </nav>
     </div>
   </header>

From 734e95f9f4193d75e8da39cddb06ec51630ef2df Mon Sep 17 00:00:00 2001
From: SUMAN_SINGH-SDE-1 <suman.singh@softsages.com>
Date: Fri, 2 Feb 2024 17:29:59 +0530
Subject: [PATCH 20/29] promise in js

---
 Promise.js | 76 +++++++++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 67 insertions(+), 9 deletions(-)

diff --git a/Promise.js b/Promise.js
index fd564dd..5805858 100644
--- a/Promise.js
+++ b/Promise.js
@@ -1,11 +1,69 @@
+const cart = ["shoes", "pants", "Kurta"];
 
+// Function to simulate API calls with the same function names
+function apiOperation(data) {
+    return new Promise((resolve) => {
+        setTimeout(function () {
+            // Simulating API response
+            resolve();
+        }, 1000 * 5); // Delayed by 5 seconds for demonstration
+    });
+}
 
-const GITHUB_API = 'https://api.github.com/users/sumansingh226';
-
-const user = fetch(GITHUB_API);
-console.log(user);
-
-
-user.then(function (data) {
-    console.log(data);
-})
+apiOperation(cart)
+    .then(() => {
+        console.log("Order created");
+        return apiOperation(null);
+    })
+    .then(() => {
+        console.log("Proceeded to payment");
+        return apiOperation(null);
+    })
+    .then(() => {
+        console.log("Order summary displayed");
+        return apiOperation(null);
+    })
+    .then(() => {
+        console.log("Wallet updated");
+        return apiOperation(null);
+    })
+    .then(() => {
+        console.log("Discount applied");
+        return apiOperation(null);
+    })
+    .then(() => {
+        console.log("Payment verified");
+        return apiOperation(null);
+    })
+    .then(() => {
+        console.log("Confirmation email sent");
+        return apiOperation(null);
+    })
+    .then(() => {
+        console.log("Shipping notified");
+        return apiOperation(null);
+    })
+    .then(() => {
+        console.log("Order tracked");
+        return apiOperation(null);
+    })
+    .then(() => {
+        console.log("Thank you page shown");
+        return apiOperation(null);
+    })
+    .then(() => {
+        console.log("Feedback requested");
+        return apiOperation(null);
+    })
+    .then(() => {
+        console.log("Survey shown");
+        return apiOperation(null);
+    })
+    .then(() => {
+        console.log("Customer profile updated");
+        return apiOperation(null);
+    })
+    .then(() => {
+        console.log("Analytics logged");
+        console.log("All operations completed!");
+    });

From 7302bd96c46366e57e77676d8ad9e85b5392c896 Mon Sep 17 00:00:00 2001
From: SUMAN_SINGH-SDE-1 <suman.singh@softsages.com>
Date: Mon, 5 Feb 2024 18:49:42 +0530
Subject: [PATCH 21/29] this keyword

---
 SlidingWindow/tempCodeRunnerFile.js |  1 +
 index.html                          |  6 +-
 thisKeyword.js                      | 95 +++++++++++++++++++++++++++++
 3 files changed, 100 insertions(+), 2 deletions(-)
 create mode 100644 SlidingWindow/tempCodeRunnerFile.js
 create mode 100644 thisKeyword.js

diff --git a/SlidingWindow/tempCodeRunnerFile.js b/SlidingWindow/tempCodeRunnerFile.js
new file mode 100644
index 0000000..463d871
--- /dev/null
+++ b/SlidingWindow/tempCodeRunnerFile.js
@@ -0,0 +1 @@
+windowStart
\ No newline at end of file
diff --git a/index.html b/index.html
index e877c81..8f5bd99 100644
--- a/index.html
+++ b/index.html
@@ -21,7 +21,8 @@
  <!-- <script src="./higherOrderFunction.js"></script> -->
  <!-- <script src="./callbackHell.js"></script> -->
 
- <script src="./Promise.js"></script>
+ <!-- <script src="./Promise.js"></script> -->
+ <script src="./thisKeyword.js"></script>
  <script
  src="https://platform.linkedin.com/badges/js/profile.js"
  async
@@ -34,7 +35,8 @@
   <header>
     <div class="container">
       <h1>JavaScript Topics</h1>
-      <button id="clickMe">Click Me</button>
+      <button id="clickMe" onclick="alert(this)">Click Me</button>
+      <button id="clickMe1" onclick="alert(this.tagName)">Click Me1</button>
       <div
       class="badge-base LI-profile-badge"
       data-locale="en_US"
diff --git a/thisKeyword.js b/thisKeyword.js
new file mode 100644
index 0000000..bee982d
--- /dev/null
+++ b/thisKeyword.js
@@ -0,0 +1,95 @@
+
+/* 00:00 🔑 JavaScript's "this" keyword can be confusing for many and behaves differently in various scenarios.
+00:55 🔑 The behavior of the "this" keyword depends on the context, such as whether it's in a function, global space, or an arrow function.
+04:17 🔑 In the global space, the value of "this" is the global object, which can vary depending on the JavaScript runtime environment (e.g., window in browsers, Global in Node.js).
+07:30 🔑 Inside a function, the value of "this" can be undefined in strict mode or the global object in non-strict mode.
+10:06 🔑 JavaScript uses a mechanism called "this substitution," where "this" is replaced with the global object when it's undefined or null in non-strict mode.
+16:11 🔑 Inside an object's method, "this" refers to the object itself where the method is called.
+21:11 🔑 "call," "apply," and "bind" are important functions used to manipulate the value of "this" when calling methods and sharing them between objects.
+26:23 🔑 It's essential to understand "call," "apply," and "bind" to effectively control the value of "this" in JavaScript methods.
+27:30 🔑 In global space, the 'this' keyword refers to the global object (e.g., 'window' in the browser).
+28:08 🔑 In strict mode, 'this' inside a function is undefined; in non-strict mode, it refers to the global object.
+35:23 🔑 Understanding "this" substitution: When 'this' is undefined or null inside a function, it becomes the global object.
+39:59 🔑 Inside an object's method, 'this' refers to the object itself.
+44:12 🔑 The 'call' method can be used to invoke a function with a specific 'this' context.
+46:01 🔑 Arrow functions do not have their own 'this' binding and take the value of the enclosing lexical context.
+48:46 🔑 In the context of DOM elements, 'this' refers to the specific HTML element being interacted with. */
+
+"use strict"
+
+/*Global Context:
+ *******this keyword in global space
+When used outside of any function, this refers to the global object.
+In browsers, the global object is window, while in Node.js, it's global. 
+In web development, the "window" object is a global object that represents
+ the browser window or frame that contains the document being viewed.
+
+*/
+
+console.log("global space", this);
+
+// this inside a function
+function x() {
+    // depend on strict  mode 
+    console.log("this inside a function ", this);
+}
+
+//this in a non-strict mode  - (this substitutions)
+// if the value of this keyword is undefined or
+// null this will be replaced with global object(only in non-strict mode)
+
+// this keyword value depend upton how it is calling 
+x()
+window.x()
+
+
+
+// this inside object's method 
+
+const student = {
+    name: "Suman Singh",
+    printName: function () {
+        console.log("this inside object's method ", this);
+        console.log(" this.a", this.name);
+    }
+}
+student.printName()
+
+const student2 = {
+    name: "Suman Chauhan",
+}
+
+student.printName.call(student2)
+
+// call apply bind methods (sharing )
+
+
+
+//inside arrow function
+
+// arrow function dose not have their own this keyword it use it's lexical this
+
+const obj = {
+    name: "Suman Chauhan",
+    x: () => {
+        console.log("this inside arrow", this);
+    }
+}
+
+obj.x()
+const obj2 = {
+    name: "Suman Chauhan",
+    x: function () {
+        console.log("this outer inside nested arrow", this);
+        return () => {
+            console.log("this inside nested arrow", this);
+        };
+    }
+};
+
+obj2.x()
+
+
+// this keyword in dom
+// value is reference  to html element 
+

From c3fbb927f6fabdf0c83dd7edd2b4a36218067c11 Mon Sep 17 00:00:00 2001
From: SUMAN_SINGH-SDE-1 <suman.singh@softsages.com>
Date: Mon, 5 Feb 2024 19:06:29 +0530
Subject: [PATCH 22/29] set in js

---
 SetInJs.js     | 29 +++++++++++++++++++++++++++++
 index.html     |  3 ++-
 thisKeyword.js |  5 +++++
 3 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 SetInJs.js

diff --git a/SetInJs.js b/SetInJs.js
new file mode 100644
index 0000000..aa386da
--- /dev/null
+++ b/SetInJs.js
@@ -0,0 +1,29 @@
+// Creating a Set
+const mySet = new Set();
+
+// Adding elements to the Set
+mySet.add(1);
+mySet.add('Hello');
+mySet.add(true);
+mySet.add(1); // This duplicate value won't be added
+
+// Checking the size of the Set
+console.log("Size of the Set:", mySet.size); // Output: 3
+
+// Checking if an element exists in the Set
+console.log("Checking if 'Hello' exists in the Set:", mySet.has('Hello')); // Output: true
+
+// Deleting an element from the Set
+mySet.delete(true);
+
+// Iterating over the Set
+console.log("Iterating over the Set:");
+mySet.forEach(item => console.log(item));
+
+// Converting Set to Array
+const myArray = Array.from(mySet);
+console.log("Set converted to Array:", myArray); // Output: [1, 'Hello']
+
+// Clearing the Set
+mySet.clear();
+console.log("Cleared Set:", mySet); // Output: Set {}
diff --git a/index.html b/index.html
index 8f5bd99..6cc5e7e 100644
--- a/index.html
+++ b/index.html
@@ -22,7 +22,8 @@
  <!-- <script src="./callbackHell.js"></script> -->
 
  <!-- <script src="./Promise.js"></script> -->
- <script src="./thisKeyword.js"></script>
+ <!-- <script src="./thisKeyword.js"></script> -->
+ <script src="./SetInJs.js"></script>
  <script
  src="https://platform.linkedin.com/badges/js/profile.js"
  async
diff --git a/thisKeyword.js b/thisKeyword.js
index bee982d..68e6595 100644
--- a/thisKeyword.js
+++ b/thisKeyword.js
@@ -93,3 +93,8 @@ obj2.x()
 // this keyword in dom
 // value is reference  to html element 
 
+
+let arr1 = [1, 2, 5]
+let arr2 = [1, 2, 5]
+arr1 = [...arr1, ...arr2]
+console.log("arr1", arr1);
\ No newline at end of file

From 43a57876086756c423f859ad5fd4fd44f02deecd Mon Sep 17 00:00:00 2001
From: SUMAN_SINGH-SDE-1 <suman.singh@softsages.com>
Date: Mon, 5 Feb 2024 19:15:51 +0530
Subject: [PATCH 23/29] set in js

---
 index.html |  3 ++-
 maps.js    | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 1 deletion(-)
 create mode 100644 maps.js

diff --git a/index.html b/index.html
index 6cc5e7e..8868fc9 100644
--- a/index.html
+++ b/index.html
@@ -23,7 +23,8 @@
 
  <!-- <script src="./Promise.js"></script> -->
  <!-- <script src="./thisKeyword.js"></script> -->
- <script src="./SetInJs.js"></script>
+ <!-- <script src="./SetInJs.js"></script> -->
+ <script src="./maps.js"></script>
  <script
  src="https://platform.linkedin.com/badges/js/profile.js"
  async
diff --git a/maps.js b/maps.js
new file mode 100644
index 0000000..cb4c696
--- /dev/null
+++ b/maps.js
@@ -0,0 +1,33 @@
+// Creating a Map
+const myMap = new Map();
+
+// Adding key-value pairs to the Map
+myMap.set(1, 'John');
+myMap.set(true, 30);
+myMap.set("fun", function name(params) {
+
+});
+
+// Retrieving values from the Map
+console.log("Name:", myMap.get('name')); // Output: John
+console.log("Age:", myMap.get('age')); // Output: 30
+console.log("City:", myMap.get('city')); // Output: New York
+
+// Checking if a key exists in the Map
+console.log("Does the Map contain key 'name'?", myMap.has('name')); // Output: true
+console.log("Does the Map contain key 'gender'?", myMap.has('gender')); // Output: false
+
+// Getting the size of the Map
+console.log("Size of the Map:", myMap.size); // Output: 3
+
+// Deleting a key from the Map
+myMap.delete('city');
+
+// Iterating over the Map
+console.log("Iterating over the Map:");
+myMap.forEach((value, key) => {
+    console.log(key, ":", value);
+});
+
+// Clearing the Map
+myMap.clear();

From 1d5f18477c3d359e0b5e538b01c4d866a90c50d8 Mon Sep 17 00:00:00 2001
From: SUMAN_SINGH-SDE-1 <suman.singh@softsages.com>
Date: Tue, 6 Feb 2024 12:24:03 +0530
Subject: [PATCH 24/29] node

---
 callApllyBind.js | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 callApllyBind.js

diff --git a/callApllyBind.js b/callApllyBind.js
new file mode 100644
index 0000000..968ba89
--- /dev/null
+++ b/callApllyBind.js
@@ -0,0 +1,21 @@
+
+let name = {
+    firstName: "suman",
+    lastName: "chauhan",
+
+}
+let printFullName = function (homeTown, state) {
+    console.log(this.firstName + " " + this.lastName + " " + "from" + " " + homeTown + " " + state);
+}
+printFullName.call(name, "Tehri", "Uttrakhand")
+
+let name2 = {
+    firstName: "suman",
+    lastName: "chauhan2",
+}
+
+printFullName.apply(name, ["Tehri11", "Uttrakhand111"])
+
+
+let printMyName = printFullName.bind(name2, ["Tehri11", "Uttrakhand111"])
+console.log("printMyName", printMyName);
\ No newline at end of file

From ceb57a36bbbe8138f611687ab32ed27a943abe6d Mon Sep 17 00:00:00 2001
From: SUMAN_SINGH-SDE-1 <suman.singh@softsages.com>
Date: Tue, 6 Feb 2024 12:25:15 +0530
Subject: [PATCH 25/29] call apply bind

---
 .vscode/settings.json | 5 ++++-
 index.html            | 3 ++-
 tempCodeRunnerFile.js | 8 +++++++-
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/.vscode/settings.json b/.vscode/settings.json
index d97764d..81be708 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,3 +1,6 @@
 {
-  "cSpell.words": ["Namaste"]
+  "cSpell.words": [
+    "Namaste",
+    "Uttrakhand"
+  ]
 }
diff --git a/index.html b/index.html
index 8868fc9..1a83981 100644
--- a/index.html
+++ b/index.html
@@ -24,7 +24,8 @@
  <!-- <script src="./Promise.js"></script> -->
  <!-- <script src="./thisKeyword.js"></script> -->
  <!-- <script src="./SetInJs.js"></script> -->
- <script src="./maps.js"></script>
+ <!-- <script src="./maps.js"></script> -->
+ <script src="./callApllyBind.js"></script>
  <script
  src="https://platform.linkedin.com/badges/js/profile.js"
  async
diff --git a/tempCodeRunnerFile.js b/tempCodeRunnerFile.js
index 51de09c..57354a0 100644
--- a/tempCodeRunnerFile.js
+++ b/tempCodeRunnerFile.js
@@ -1 +1,7 @@
-const calculateCircumference = function (radius) {
+name2 = {
+//     firstName: "suman",
+//     lastName: "chauhan2",
+// }
+
+// //function borrowing
+// name.printFullName.call(name2)
\ No newline at end of file

From 638be59bf652211d26d479358583ac7adf016fd7 Mon Sep 17 00:00:00 2001
From: SUMAN_SINGH-SDE-1 <suman.singh@softsages.com>
Date: Tue, 6 Feb 2024 12:52:45 +0530
Subject: [PATCH 26/29] bind polyfille

---
 bindPolyFill.js       | 26 ++++++++++++++++++++++++++
 index.html            |  3 ++-
 tempCodeRunnerFile.js |  8 +-------
 3 files changed, 29 insertions(+), 8 deletions(-)
 create mode 100644 bindPolyFill.js

diff --git a/bindPolyFill.js b/bindPolyFill.js
new file mode 100644
index 0000000..6960804
--- /dev/null
+++ b/bindPolyFill.js
@@ -0,0 +1,26 @@
+let name = {
+    firstName: "suman",
+    lastName: "chauhan",
+}
+
+let name2 = {
+    firstName: "Summi",
+    lastName: "chauhan",
+}
+
+let printName = function (homeTown, state, country) {
+    console.log(this.firstName + " " + this.lastName + " " + "from" + " " + homeTown + " " + state + " " + country);
+}
+
+let printMyName = printName.bind(name, "Tehri", "Uttrakhand")
+printMyName("india")
+
+Function.prototype.myBind = function (...args) {
+    let obj = this;
+    return function (...args2) {
+        return obj.apply(args[0], [...args.slice(1), args2]); // Added return statement
+    }
+}
+
+let printMyName2 = printName.myBind(name2, "Dehradoon", "Uttrakhand")
+printMyName2("india")
diff --git a/index.html b/index.html
index 1a83981..34d0c24 100644
--- a/index.html
+++ b/index.html
@@ -25,7 +25,8 @@
  <!-- <script src="./thisKeyword.js"></script> -->
  <!-- <script src="./SetInJs.js"></script> -->
  <!-- <script src="./maps.js"></script> -->
- <script src="./callApllyBind.js"></script>
+ <!-- <script src="./callApllyBind.js"></script> -->
+ <script src="./bindPolyFill.js"></script>
  <script
  src="https://platform.linkedin.com/badges/js/profile.js"
  async
diff --git a/tempCodeRunnerFile.js b/tempCodeRunnerFile.js
index 57354a0..4d19f5d 100644
--- a/tempCodeRunnerFile.js
+++ b/tempCodeRunnerFile.js
@@ -1,7 +1 @@
-name2 = {
-//     firstName: "suman",
-//     lastName: "chauhan2",
-// }
-
-// //function borrowing
-// name.printFullName.call(name2)
\ No newline at end of file
+Tehri
\ No newline at end of file

From 84510a85a2f7b90ef2ad48ae3a0eb6da086d779a Mon Sep 17 00:00:00 2001
From: SUMAN_SINGH-SDE-1 <suman.singh@softsages.com>
Date: Tue, 6 Feb 2024 16:19:40 +0530
Subject: [PATCH 27/29] debauncing in js

---
 debaunce.js |  43 ++++++++++++++++++
 index.html  |   5 +-
 style.css   | 129 ++++++++++++++++++++++++++++++----------------------
 3 files changed, 120 insertions(+), 57 deletions(-)
 create mode 100644 debaunce.js

diff --git a/debaunce.js b/debaunce.js
new file mode 100644
index 0000000..b51599d
--- /dev/null
+++ b/debaunce.js
@@ -0,0 +1,43 @@
+let counter = 0;
+const fruits = [
+    "Apple",
+    "Banana",
+    "Orange",
+    "Grape",
+    "Strawberry",
+    "Watermelon",
+    "Pineapple",
+    "Mango",
+    "Kiwi",
+    "Blueberry",
+    "Peach",
+    "Cherry",
+    "Pear",
+    "Lemon",
+    "Raspberry",
+    "Cantaloupe",
+    "Plum",
+    "Apricot",
+    "Pomegranate",
+    "Coconut",
+];
+
+const handleSearch = () => {
+    let searchValue = document.getElementById("searchInput").value;
+    const fruitList = fruits.filter((fruit) => fruit.includes(searchValue));
+    console.log("fruitList", fruitList);
+};
+const doSomeMagic = function (fn, delay) {
+    let timer;
+    return function () {
+        let context = this;
+        args = arguments;
+        clearTimeout(timer);
+        timer = setTimeout(() => {
+            handleSearch.apply(context, arguments);
+            clearTimeout(timer);
+        }, delay);
+    };
+};
+
+const betterFunction = doSomeMagic(handleSearch, 1000);
diff --git a/index.html b/index.html
index 34d0c24..3da31fc 100644
--- a/index.html
+++ b/index.html
@@ -26,7 +26,8 @@
  <!-- <script src="./SetInJs.js"></script> -->
  <!-- <script src="./maps.js"></script> -->
  <!-- <script src="./callApllyBind.js"></script> -->
- <script src="./bindPolyFill.js"></script>
+ <!-- <script src="./bindPolyFill.js"></script> -->
+ <script src="./debaunce.js"></script>
  <script
  src="https://platform.linkedin.com/badges/js/profile.js"
  async
@@ -59,7 +60,7 @@ <h1>JavaScript Topics</h1>
        
       </nav>
     </div>
-  </header>
+    <input type="text" id="searchInput" placeholder="Search..." onkeyup="betterFunction()">  </header>
   
   <section id="core-concepts" class="topic-list">
     <div class="container">
diff --git a/style.css b/style.css
index 3a1cfce..9924598 100644
--- a/style.css
+++ b/style.css
@@ -1,56 +1,75 @@
 body {
-    font-family: 'Arial', sans-serif;
-    margin: 0;
-    padding: 0;
-    background-color: #f9f9f9;
-    color: #333;
-  }
-  
-  .container {
-    width: 80%;
-    margin: 0 auto;
-  }
-  
-  header {
-    background-color: #3498db;
-    color: #fff;
-    text-align: center;
-    padding: 1em 0;
-  }
-  
-  h1, h2 {
-    color: #3498db;
-  }
-  
-  .topic-list {
-    margin: 20px 0;
-    padding: 20px 0;
-    background-color: #fff;
-    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
-    border-radius: 8px;
-  }
-  
-  ul {
-    list-style-type: none;
-    padding: 0;
-  }
-  
-  li {
-    padding: 10px 0;
-    border-bottom: 1px solid #eee;
-  }
-  
-  li:last-child {
-    border-bottom: none;
-  }
-  
-  footer {
-    background-color: #3498db;
-    color: #fff;
-    text-align: center;
-    padding: 1em 0;
-    position: fixed;
-    bottom: 0;
-    width: 100%;
-  }
-  
\ No newline at end of file
+  font-family: "Arial", sans-serif;
+  margin: 0;
+  padding: 0;
+  background-color: #f9f9f9;
+  color: #333;
+}
+
+.container {
+  width: 80%;
+  margin: 0 auto;
+}
+
+header {
+  background-color: #3498db;
+  color: #fff;
+  text-align: center;
+  padding: 1em 0;
+}
+
+h1,
+h2 {
+  color: #3498db;
+}
+
+.topic-list {
+  margin: 20px 0;
+  padding: 20px 0;
+  background-color: #fff;
+  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
+  border-radius: 8px;
+}
+
+ul {
+  list-style-type: none;
+  padding: 0;
+}
+
+li {
+  padding: 10px 0;
+  border-bottom: 1px solid #eee;
+}
+
+li:last-child {
+  border-bottom: none;
+}
+
+footer {
+  background-color: #3498db;
+  color: #fff;
+  text-align: center;
+  padding: 1em 0;
+  position: fixed;
+  bottom: 0;
+  width: 100%;
+}
+#searchInput {
+  width: 300px;
+  padding: 10px;
+  font-size: 16px;
+}
+
+#searchResults {
+  list-style-type: none;
+  padding: 0;
+}
+
+#searchResults li {
+  padding: 5px 10px;
+  cursor: pointer;
+}
+
+#searchResults li:hover {
+  background-color: #f0f0f0;
+}

From d27798ace8a429f2f295e474419034f19423d134 Mon Sep 17 00:00:00 2001
From: SUMAN_SINGH-SDE-1 <suman.singh@softsages.com>
Date: Wed, 7 Feb 2024 13:09:08 +0530
Subject: [PATCH 28/29] throltling

---
 Throttling .js | 25 +++++++++++++++++++++++++
 index.html     |  5 ++++-
 2 files changed, 29 insertions(+), 1 deletion(-)
 create mode 100644 Throttling .js

diff --git a/Throttling .js b/Throttling .js
new file mode 100644
index 0000000..847515f
--- /dev/null
+++ b/Throttling .js	
@@ -0,0 +1,25 @@
+function throttle(func, delay) {
+    let lastCalled = 0;
+
+    return function (...args) {
+        const now = new Date().getTime();
+        if (now - lastCalled < delay) {
+            return;
+        }
+
+        lastCalled = now;
+        func.apply(this, args);
+    };
+}
+
+function makeApiRequest() {
+    // Simulate an API request by logging a message after 1 second
+    setTimeout(() => {
+        console.log("API request triggered");
+    }, 1000);
+}
+
+const throttledApiRequest = throttle(makeApiRequest, 1000);
+
+// Add event listener to the button
+document.getElementById("triggerButton").addEventListener("click", throttledApiRequest);
diff --git a/index.html b/index.html
index 3da31fc..dc60488 100644
--- a/index.html
+++ b/index.html
@@ -27,7 +27,8 @@
  <!-- <script src="./maps.js"></script> -->
  <!-- <script src="./callApllyBind.js"></script> -->
  <!-- <script src="./bindPolyFill.js"></script> -->
- <script src="./debaunce.js"></script>
+ <!-- <script src="./debaunce.js"></script> -->
+
  <script
  src="https://platform.linkedin.com/badges/js/profile.js"
  async
@@ -40,6 +41,7 @@
   <header>
     <div class="container">
       <h1>JavaScript Topics</h1>
+      <button id="triggerButton">Trigger API Request for throttle</button>
       <button id="clickMe" onclick="alert(this)">Click Me</button>
       <button id="clickMe1" onclick="alert(this.tagName)">Click Me1</button>
       <div
@@ -108,4 +110,5 @@ <h2>Additional Topics</h2>
     </div>
   </footer>
 </body>
+<script src="./Throttling .js"></script>
 </html>
\ No newline at end of file

From fc7682f7838150b1f13a419e1b6d5e7e85cfd47a Mon Sep 17 00:00:00 2001
From: SUMAN_SINGH-SDE-1 <suman.singh@softsages.com>
Date: Wed, 7 Feb 2024 19:07:24 +0530
Subject: [PATCH 29/29] prototype

---
 Oops.js        |  0
 ProtoType.js   | 29 +++++++++++++++++++++++++++++
 Throttling .js |  1 -
 index.html     |  3 +++
 4 files changed, 32 insertions(+), 1 deletion(-)
 create mode 100644 Oops.js
 create mode 100644 ProtoType.js

diff --git a/Oops.js b/Oops.js
new file mode 100644
index 0000000..e69de29
diff --git a/ProtoType.js b/ProtoType.js
new file mode 100644
index 0000000..303fde4
--- /dev/null
+++ b/ProtoType.js
@@ -0,0 +1,29 @@
+
+const arr = ["Suman", "singh", "chauhan"];
+
+function multiplyBy5(n) {
+    return n * 5
+}
+
+console.log(multiplyBy5(5));
+console.log(multiplyBy5.myName = "suman");
+
+
+function createUser(userName, score) {
+    this.userName = userName;
+    this.score = score;
+}
+
+createUser.prototype.increment = function () {
+    this.score++;
+}
+createUser.prototype.printMe = function () {
+    console.log(`score  is  ${this.score}`);
+}
+const chai = new createUser("chai", 25)
+const tea = new createUser("tea", 250)
+
+chai.printMe()
+tea.printMe()
+
+
diff --git a/Throttling .js b/Throttling .js
index 847515f..59c156a 100644
--- a/Throttling .js	
+++ b/Throttling .js	
@@ -6,7 +6,6 @@ function throttle(func, delay) {
         if (now - lastCalled < delay) {
             return;
         }
-
         lastCalled = now;
         func.apply(this, args);
     };
diff --git a/index.html b/index.html
index dc60488..4035797 100644
--- a/index.html
+++ b/index.html
@@ -111,4 +111,7 @@ <h2>Additional Topics</h2>
   </footer>
 </body>
 <script src="./Throttling .js"></script>
+<!-- <script src="./ProtoType.js"></script> -->
+<!-- <script src="./ProtoType.js"></script> -->
+
 </html>
\ No newline at end of file
