diff --git a/.gitignore b/.gitignore index 29fc948..1c6054b 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,6 @@ day9.md day10.md 01_02_03_days_backup.md test.md -28_Day 29_Day 30_Day test.html diff --git a/02_Day/02_day_data_types.md b/02_Day/02_day_data_types.md index 77b1c27..bdba380 100644 --- a/02_Day/02_day_data_types.md +++ b/02_Day/02_day_data_types.md @@ -617,7 +617,7 @@ console.log(string.charCodeAt(lastIndex)) // t ASCII is 116 ``` -13. *indexOf()*: Takes takes a substring and if the substring exists in a string it returns the first position of the substring if does not exist it returns -1 +1. *indexOf()*: Takes a substring and if the substring exists in a string it returns the first position of the substring if does not exist it returns -1 ```js string.indexOf(substring) @@ -635,10 +635,11 @@ console.log(string.indexOf('Script')) //15 console.log(string.indexOf('script')) // -1 ``` -14. *lastIndexOf()*: Takes takes a substring and if the substring exists in a string it returns the last position of the substring if it does not exist it returns -1 +1. *lastIndexOf()*: Takes a substring and if the substring exists in a string it returns the last position of the substring if it does not exist it returns -1 ```js -string.lastIndexOf(index) +//syntax +string.lastIndexOf(substring) ``` ```js @@ -801,7 +802,7 @@ console.log(typeof null) // object ### Changing data type(Casting) -- Casting: Converting one data type to another data type. We use _parseInt()_, _parsefloat()_,_Number()_, _+ sign_, _str()_ +- Casting: Converting one data type to another data type. We use _parseInt()_, _parseFloat()_, _Number()_, _+ sign_, _str()_ When we do arithmetic operations string numbers should be first converted to integer or float if not it returns an error. #### String to Int @@ -941,13 +942,13 @@ console.log(numInt) // 9 5 1 5 25 125 ``` -9. Use __substr__ to slice out the phase __because because because__ in the following sentence:__'You cannot end a sentence with because because because is a conjunction'__ +9. Use __substr__ to slice out the phrase __because because because__ in the following sentence:__'You cannot end a sentence with because because because is a conjunction'__ ### Exercises: Level 3 1. '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. 2. Use __match()__ to count the number all because's in the following sentence:__'You cannot end a sentence with because because because is a conjunction'__ -3. Clean the following text and find the most frequent word(hint, use replace and regular express). +3. Clean the following text and find the most frequent word (hint, use replace and regular express). ```js 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' diff --git a/03_Day/03_booleans_operators_date.md b/03_Day/03_booleans_operators_date.md index b080789..fc856ac 100644 --- a/03_Day/03_booleans_operators_date.md +++ b/03_Day/03_booleans_operators_date.md @@ -125,10 +125,10 @@ Arithmetic operators are mathematical operators. - Addition(+): a + b - Subtraction(-): a - b -- Multiplication(_): a _ b +- Multiplication(*): a * b - Division(/): a / b -- Modulus(%):a % b -- Exponential(**):a ** b +- Modulus(%): a % b +- Exponential(**): a ** b ```js let numOne = 4 @@ -231,15 +231,15 @@ The following symbols are the common logical operators: ```js //&& ampersand operator example -const check = 4 > 3 && 10 > 5 // true and true -> true -const check = 4 > 3 && 10 < 5 // true and false -> false -const check = 4 < 3 && 10 < 5 // false and false -> false +const check = 4 > 3 && 10 > 5 // true && true -> true +const check = 4 > 3 && 10 < 5 // true && false -> false +const check = 4 < 3 && 10 < 5 // false && false -> false //|| pipe or operator, example -const check = 4 > 3 || 10 > 5 // true and true -> true -const check = 4 > 3 || 10 < 5 // true and false -> true -const check = 4 < 3 || 10 < 5 // false and false -> false +const check = 4 > 3 || 10 > 5 // true || true -> true +const check = 4 > 3 || 10 < 5 // true || false -> true +const check = 4 < 3 || 10 < 5 // false || false -> false //! Negation examples diff --git a/05_Day/05_day_arrays.md b/05_Day/05_day_arrays.md index 5556976..3fd2db3 100644 --- a/05_Day/05_day_arrays.md +++ b/05_Day/05_day_arrays.md @@ -331,7 +331,7 @@ const eight0values = Array(8).fill(0) // it creates eight element values filled console.log(eight0values) // [0, 0, 0, 0, 0, 0, 0, 0] const four4values = Array(4).fill(4) // it creates 4 element values filled with '4' -console.log(four4values) // [4, 4, 4, 4, 4, 4, 4, 4] +console.log(four4values) // [4, 4, 4, 4] ``` #### Concatenating array using concat diff --git a/28_Day/28_day_dom_day_8.md b/28_Day/28_day_dom_day_8.md new file mode 100644 index 0000000..6e7e195 --- /dev/null +++ b/28_Day/28_day_dom_day_8.md @@ -0,0 +1,37 @@ +
+ +[<< Day 27](https://github.com/Asabeneh/30DaysOfJavaScript/blob/master27_Day27_day_dom_day_7.md) | [Day 29>>](https://github.com/Asabeneh/30DaysOfJavaScript/blob/master/29_Day/29_day_dom_day_9.md) + + + +- [Day 28](#day-28) + - [Exercises](#exercises) + - [Exercise: Level 1](#exercise-level-1) + +# Day 28 + +## Exercises + +### Exercise: Level 1 + +1. Create the following using HTML, CSS, and JavaScript + + + +🎉 CONGRATULATIONS ! 🎉 + +[<< Day 27](https://github.com/Asabeneh/30DaysOfJavaScript/blob/master27_Day27_day_dom_day_7.md) | [Day 29>>](https://github.com/Asabeneh/30DaysOfJavaScript/blob/master/29_Day/29_day_dom_day_9.md) diff --git a/28_Day/28_day_starter/index.html b/28_Day/28_day_starter/index.html new file mode 100644 index 0000000..6efcab4 --- /dev/null +++ b/28_Day/28_day_starter/index.html @@ -0,0 +1,17 @@ + + + + +