From a969506b6d8dc025a24a9668ad37ca47c4aa9373 Mon Sep 17 00:00:00 2001 From: codal-tshah Date: Wed, 16 Oct 2024 12:31:05 +0530 Subject: [PATCH 1/3] CIT-539 #time 2h Complted the Javascript learning part 3 --- js/js_part3/assignment.html | 12 +++++++++ js/js_part3/assignment.js | 51 +++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 js/js_part3/assignment.html create mode 100644 js/js_part3/assignment.js diff --git a/js/js_part3/assignment.html b/js/js_part3/assignment.html new file mode 100644 index 0000000..bd90188 --- /dev/null +++ b/js/js_part3/assignment.html @@ -0,0 +1,12 @@ + + + + + + Assignment part 3 + + + +

Assignment

+ + \ No newline at end of file diff --git a/js/js_part3/assignment.js b/js/js_part3/assignment.js new file mode 100644 index 0000000..c3a338e --- /dev/null +++ b/js/js_part3/assignment.js @@ -0,0 +1,51 @@ +//Question 1 +let numberArray = [8,9,0,7,2,-2,0,600,59] +let n = 6 + +let ans = numberArray.slice(0,n) +console.log(ans) + +//Question 2 +let newArray = [8,9,0,7,2,-2,0,600,59] +let num = 3 + +let result = newArray.slice(-num) +console.log(result) + + +//Question 3 +let mystring = " lo diwdwhd woisw wp "; +let check = mystring.trim(); +console.log('after slicing mystring:',check) +if (check==""){ + console.log('mystring is empty') +}else{ + console.log('mystring is not empty:',mystring) +} + +//Question 4 +let char = 'p'; +console.log('character : ', char) +let lowercase = char.toLowerCase(); +if(char == lowercase){ + console.log('Given character is in lowercase') +}else{ + console.log('character is in uppercase', char) +} + +//Question 5 +let theString = ' Vingadium Leviyosa ' +console.log('string is:', theString) +console.log('After removing whitespaces string is :', theString.trim()) + + +//Question 6 +let company = ['microsoft', 'apple', 'blackrock', 'tcs'] +console.log('list of company:', company) +let checkCompany = 'apple' +console.log('company name:', checkCompany) +if(company.includes(checkCompany)){ + console.log('company exists') +}else{ + console.log('company doesnt exist') +} \ No newline at end of file From ce420d31c74bc7a595f371c6d5cd5c8eb61a3bbc Mon Sep 17 00:00:00 2001 From: codal-tshah Date: Wed, 16 Oct 2024 12:32:22 +0530 Subject: [PATCH 2/3] notes --- js/notes.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 js/notes.txt diff --git a/js/notes.txt b/js/notes.txt new file mode 100644 index 0000000..a3485c3 --- /dev/null +++ b/js/notes.txt @@ -0,0 +1,2 @@ +16_oct +- completed the javascript learning of part 3 From e21c44bb849801e3f4b57400efada4852c88de9a Mon Sep 17 00:00:00 2001 From: codal-tshah Date: Thu, 17 Oct 2024 11:37:09 +0530 Subject: [PATCH 3/3] CIT-539 #time 2h Compledted the Javascript learning Part 4 --- js/js_part4/assignment.html | 12 ++++++++++++ js/js_part4/assignment.js | 14 ++++++++++++++ js/js_part4/practice.html | 12 ++++++++++++ js/js_part4/practice.js | 11 +++++++++++ js/notes.txt | 3 +++ 5 files changed, 52 insertions(+) create mode 100644 js/js_part4/assignment.html create mode 100644 js/js_part4/assignment.js create mode 100644 js/js_part4/practice.html create mode 100644 js/js_part4/practice.js diff --git a/js/js_part4/assignment.html b/js/js_part4/assignment.html new file mode 100644 index 0000000..6c81906 --- /dev/null +++ b/js/js_part4/assignment.html @@ -0,0 +1,12 @@ + + + + + + Assignment part 4 + + + +

Assignment

+ + \ No newline at end of file diff --git a/js/js_part4/assignment.js b/js/js_part4/assignment.js new file mode 100644 index 0000000..50c044b --- /dev/null +++ b/js/js_part4/assignment.js @@ -0,0 +1,14 @@ +//Question 1 +let arr = [1,2,3,4,5,6,2,3] +let num = 2 +let i = 0 +while(i + + + + + Practice + + + +

Practice

+ + \ No newline at end of file diff --git a/js/js_part4/practice.js b/js/js_part4/practice.js new file mode 100644 index 0000000..68c0911 --- /dev/null +++ b/js/js_part4/practice.js @@ -0,0 +1,11 @@ +console.log('List of even numbers upto 20'); +for(let a=2; a<=20; a=a+2 ){ + console.log(a); +} + +console.log('Printing the 13s table using while loop:') +let b = 13 +while(b<=130){ + console.log(b); + b=b+13; +} \ No newline at end of file diff --git a/js/notes.txt b/js/notes.txt index a3485c3..30ab98d 100644 --- a/js/notes.txt +++ b/js/notes.txt @@ -1,2 +1,5 @@ 16_oct - completed the javascript learning of part 3 +17-oct +- completed the javascript learning of part 4 +- learn the for loops and while loops also nested loops \ No newline at end of file