From 305bcf7b9b789799c67a5beabb57844c280ed4dd Mon Sep 17 00:00:00 2001 From: Karan <50290386+Sonawane-Karan26@users.noreply.github.com> Date: Wed, 24 Nov 2021 20:30:16 +0530 Subject: [PATCH] Commit --- Chapter 6/Exercise 6.1.txt | 7 ------- Chapter 6/Exercise 6.2.txt | 8 -------- Chapter 6/Exercise 6.3.txt | 11 ----------- Chapter 6/Exercise 6.4.txt | 16 ---------------- Chapter 6/Exercise 6.5.txt | 17 ----------------- Chapter 6/Exercise 6.6.txt | 10 ---------- Chapter 6/Exercise 6.7.txt | 18 ------------------ Chapter 6/Exercise 6.8.txt | 9 --------- Chapter 6/Project 1.txt | 8 -------- Chapter 6/Project 2.txt | 13 ------------- 10 files changed, 117 deletions(-) delete mode 100644 Chapter 6/Exercise 6.1.txt delete mode 100644 Chapter 6/Exercise 6.2.txt delete mode 100644 Chapter 6/Exercise 6.3.txt delete mode 100644 Chapter 6/Exercise 6.4.txt delete mode 100644 Chapter 6/Exercise 6.5.txt delete mode 100644 Chapter 6/Exercise 6.6.txt delete mode 100644 Chapter 6/Exercise 6.7.txt delete mode 100644 Chapter 6/Exercise 6.8.txt delete mode 100644 Chapter 6/Project 1.txt delete mode 100644 Chapter 6/Project 2.txt diff --git a/Chapter 6/Exercise 6.1.txt b/Chapter 6/Exercise 6.1.txt deleted file mode 100644 index 9d57ec8..0000000 --- a/Chapter 6/Exercise 6.1.txt +++ /dev/null @@ -1,7 +0,0 @@ -function adder(a, b) { -return a + b; -} -const val1 = 10; -const val2 = 20; -console.log(adder(val1, val2)); -console.log(adder(20, 30)); \ No newline at end of file diff --git a/Chapter 6/Exercise 6.2.txt b/Chapter 6/Exercise 6.2.txt deleted file mode 100644 index cc01504..0000000 --- a/Chapter 6/Exercise 6.2.txt +++ /dev/null @@ -1,8 +0,0 @@ -const adj = ["super", "wonderful", "bad", "angry", "careful"]; - -function myFun() { - const question = prompt("What is your name?"); - const nameAdj = Math.floor(Math.random() * adj.length); - console.log(adj[nameAdj] + " " + question ); -} -myFun(); diff --git a/Chapter 6/Exercise 6.3.txt b/Chapter 6/Exercise 6.3.txt deleted file mode 100644 index 977d44c..0000000 --- a/Chapter 6/Exercise 6.3.txt +++ /dev/null @@ -1,11 +0,0 @@ -const val1 = 10; -const val2 = 5; -let operat = "-"; -function cal(a, b, op) { - if (op == "-") { - console.log(a — b); - } else { - console.log(a + b); - } -} -cal(val1, val2, operat); \ No newline at end of file diff --git a/Chapter 6/Exercise 6.4.txt b/Chapter 6/Exercise 6.4.txt deleted file mode 100644 index 56c9cd2..0000000 --- a/Chapter 6/Exercise 6.4.txt +++ /dev/null @@ -1,16 +0,0 @@ -const myArr = []; - -for(let x=0; x<10; x++){ - let val1 = 5 * x; - let val2 = x * x; - let res = cal(val1, val2, "+"); - myArr.push(res); -} -console.log(myArr); -function cal(a, b, op) { - if (op == "-") { - return a - b; - } else { - return a + b; - } -} \ No newline at end of file diff --git a/Chapter 6/Exercise 6.5.txt b/Chapter 6/Exercise 6.5.txt deleted file mode 100644 index 013d083..0000000 --- a/Chapter 6/Exercise 6.5.txt +++ /dev/null @@ -1,17 +0,0 @@ -let val = "1000"; - -(function () { - let val = "100"; // local scope variable - console.log(val); -})(); - -let result = (function () { - let val = "Laurence"; - return val; -})(); -console.log(result); -console.log(val); - -(function (val) { - console.log(`My name is ${val}`); -})("Laurence"); \ No newline at end of file diff --git a/Chapter 6/Exercise 6.6.txt b/Chapter 6/Exercise 6.6.txt deleted file mode 100644 index c891f33..0000000 --- a/Chapter 6/Exercise 6.6.txt +++ /dev/null @@ -1,10 +0,0 @@ -function calcFactorial(nr) { - console.log(nr); - if (nr === 0) { - return 1; - } - else { - return nr * calcFactorial(--nr); - } -} -console.log(calcFactorial(4)); diff --git a/Chapter 6/Exercise 6.7.txt b/Chapter 6/Exercise 6.7.txt deleted file mode 100644 index b6247c5..0000000 --- a/Chapter 6/Exercise 6.7.txt +++ /dev/null @@ -1,18 +0,0 @@ -let start = 10; -function loop1(val) { - console.log(val); - if (val < 1) { - return - } - return loop1(val - 1); -} -loop1(start); -function loop2(val) { - console.log(val); - if (val > 0) { - val--; - return loop2(val); - } - return; -} -loop2(start); diff --git a/Chapter 6/Exercise 6.8.txt b/Chapter 6/Exercise 6.8.txt deleted file mode 100644 index e1a4a19..0000000 --- a/Chapter 6/Exercise 6.8.txt +++ /dev/null @@ -1,9 +0,0 @@ -const test = function(val){ - console.log(val); -} -test('hello 1'); - -function test1(val){ - console.log(val); -} -test1("hello 2"); \ No newline at end of file diff --git a/Chapter 6/Project 1.txt b/Chapter 6/Project 1.txt deleted file mode 100644 index 32d3ecb..0000000 --- a/Chapter 6/Project 1.txt +++ /dev/null @@ -1,8 +0,0 @@ -const main = function counter(i) { -console.log(i); -if (i < 10) { - return counter(i + 1); -} -return; -} -main(0); \ No newline at end of file diff --git a/Chapter 6/Project 2.txt b/Chapter 6/Project 2.txt deleted file mode 100644 index a4186f0..0000000 --- a/Chapter 6/Project 2.txt +++ /dev/null @@ -1,13 +0,0 @@ -const one = ()=> console.log('one'); -const two = ()=> console.log('two'); -const three = () =>{ - console.log('three'); - one(); - two(); -} -const four = () =>{ - console.log('four'); - setTimeout(one,0); - three(); -} -four(); \ No newline at end of file