Skip to content

Commit b600e86

Browse files
committed
added exercies
1 parent ec0f403 commit b600e86

4 files changed

Lines changed: 88 additions & 55 deletions

File tree

Exercises_Level_1.ipynb

Lines changed: 0 additions & 55 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
# JavaScript
22
Javascript
3+
4+
To Execute the script
5+
node <followed by path>
6+
Ex.
7+
node js_exercises/Level_101.js

js_exercises/Exercise_101.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
Level 1
2+
****************************************
3+
Declare a variable named challenge and assign it to an initial value '30 Days Of JavaScript'.
4+
Print the string on the browser console using console.log()
5+
Print the length of the string on the browser console using console.log()
6+
Change all the string characters to capital letters using toUpperCase() method
7+
Change all the string characters to lowercase letters using toLowerCase() method
8+
Cut (slice) out the first word of the string using substr() or substring() method
9+
Slice out the phrase Days Of JavaScript from 30 Days Of JavaScript.
10+
Check if the string contains a word Script using includes() method
11+
Split the string into an array using split() method
12+
Split the string 30 Days Of JavaScript at the space using split() method
13+
'Facebook, Google, Microsoft, Apple, IBM, Oracle, Amazon' split the string at the comma and change it to an array.
14+
Change 30 Days Of JavaScript to 30 Days Of Python using replace() method.
15+
What is character at index 15 in '30 Days Of JavaScript' string? Use charAt() method.
16+
What is the character code of J in '30 Days Of JavaScript' string using charCodeAt()
17+
Use indexOf to determine the position of the first occurrence of a in 30 Days Of JavaScript
18+
Use lastIndexOf to determine the position of the last occurrence of a in 30 Days Of JavaScript.
19+
Use indexOf to find the position of the first occurrence of the word because in the following sentence:'You cannot end a sentence with because because because is a conjunction'
20+
Use lastIndexOf to find the position of the last occurrence of the word because in the following sentence:'You cannot end a sentence with because because because is a conjunction'
21+
Use search to find the position of the first occurrence of the word because in the following sentence:'You cannot end a sentence with because because because is a conjunction'
22+
Use trim() to remove any trailing whitespace at the beginning and the end of a string.E.g ' 30 Days Of JavaScript '.
23+
Use startsWith() method with the string 30 Days Of JavaScript and make the result true
24+
Use endsWith() method with the string 30 Days Of JavaScript and make the result true
25+
Use match() method to find all the a’s in 30 Days Of JavaScript
26+
Use concat() and merge '30 Days of' and 'JavaScript' to a single string, '30 Days Of JavaScript'
27+
Use repeat() method to print 30 Days Of JavaScript 2 times
28+
29+
****************************************
30+
Level 2
31+
****************************************
32+
Using console.log() print out the following statement:
33+
34+
The quote 'There is no exercise better for the heart than reaching down and lifting people up.' by John Holmes teaches us to help one another.
35+
Using console.log() print out the following quote by Mother Teresa:
36+
37+
"Love is not patronizing and charity isn't about pity, it is about love. Charity and love are the same -- with charity you give love, so don't just give money but reach out your hand instead."
38+
Check if typeof '10' is exactly equal to 10. If not make it exactly equal.
39+
40+
Check if parseFloat('9.8') is equal to 10 if not make it exactly equal with 10.
41+
42+
Check if 'on' is found in both python and jargon
43+
44+
I hope this course is not full of jargon. Check if jargon is in the sentence.
45+
46+
Generate a random number between 0 and 100 inclusively.
47+
48+
Generate a random number between 50 and 100 inclusively.
49+
50+
Generate a random number between 0 and 255 inclusively.
51+
52+
Access the 'JavaScript' string characters using a random number.
53+
54+
Use console.log() and escape characters to print the following pattern.
55+
56+
1 1 1 1 1
57+
2 1 2 4 8
58+
3 1 3 9 27
59+
4 1 4 16 64
60+
5 1 5 25 125
61+
Use substr to slice out the phrase because because because from the following sentence:'You cannot end a sentence with because because because is a conjunction'
62+
63+
****************************************
64+
Level 3
65+
****************************************
66+
'Love is the best thing in this world. Some found their love and some are still looking for their love.' Count the number of word love in this sentence.
67+
68+
Use match() to count the number of all because in the following sentence:'You cannot end a sentence with because because because is a conjunction'
69+
70+
Clean the following text and find the most frequent word (hint, use replace and regular expressions).
71+
72+
const sentence = '%I $am@% a %tea@cher%, &and& I lo%#ve %te@a@ching%;. The@re $is no@th@ing; &as& mo@re rewarding as educa@ting &and& @emp%o@weri@ng peo@ple. ;I found tea@ching m%o@re interesting tha@n any ot#her %jo@bs. %Do@es thi%s mo@tiv#ate yo@u to be a tea@cher!? %Th#is 30#Days&OfJavaScript &is al@so $the $resu@lt of &love& of tea&ching'
73+
Calculate the total annual income of the person by extracting the numbers from the following text. 'He earns 5000 euro from salary per month, 10000 euro annual bonus, 15000 euro online courses per month.'

js_exercises/Level_101.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//Declare a variable named challenge and assign it to an initial value 'Hello World'.
2+
3+
challenge = 'Hello World'
4+
console.log(challenge)
5+
6+
//Print the string on the browser console using console.log()
7+
// Print the length of the string on the browser console using console.log()
8+
// Change all the string characters to capital letters using toUpperCase() method
9+
// Change all the string characters to lowercase letters using toLowerCase() method
10+
//Cut (slice) out the first word of the string using substr() or substring() method

0 commit comments

Comments
 (0)