pull/56/head
Asabeneh 5 years ago
parent 1145e81851
commit 9ead21a3de

@ -39,8 +39,8 @@
- [String to Int](#string-to-int) - [String to Int](#string-to-int)
- [String to Float](#string-to-float) - [String to Float](#string-to-float)
- [Float to Int](#float-to-int) - [Float to Int](#float-to-int)
- [💻 Day 2: Exercises](#%f0%9f%92%bb-day-2-exercises) - [💻 Day 2: Exercises](#%f0%9f%92%bb-day-2-exercises)
- [Exercise: Level 1](#exercise-level-1) - [Exercise: Level 1](#exercise-level-1)
- [Exercise: Level 2](#exercise-level-2) - [Exercise: Level 2](#exercise-level-2)
- [Exercises: Level 3](#exercises-level-3) - [Exercises: Level 3](#exercises-level-3)
@ -135,7 +135,7 @@ role:'teaching',
country:'Finland' country:'Finland'
} }
console.log(userOne == userTwo) console.log(userOne == userTwo) // false
``` ```
Rule of thumb, we do not compare non-primitive data types. Do not compare array, function, or object. Rule of thumb, we do not compare non-primitive data types. Do not compare array, function, or object.
@ -879,9 +879,9 @@ console.log(numInt) // 9
🌕 You are awesome. You have just completed day 2 challenges and you are two steps a head in to your way to greatness. Now do some exercises for your brain and for your muscle. 🌕 You are awesome. You have just completed day 2 challenges and you are two steps a head in to your way to greatness. Now do some exercises for your brain and for your muscle.
# 💻 Day 2: Exercises ## 💻 Day 2: Exercises
## Exercise: Level 1 ### Exercise: Level 1
1. Declare a variable name challenge and assign it to an initial value **'30 Days Of JavaScript'**. 1. Declare a variable name challenge and assign it to an initial value **'30 Days Of JavaScript'**.
2. Print the string on the browser console using __console.log()__ 2. Print the string on the browser console using __console.log()__

@ -766,15 +766,13 @@ const webTechs = [
``` ```
- Sort the array and find the min and max age - Sort the array and find the min and max age
- Find the min age and the max age
- Find the median age(one middle item or two middle items divided by two) - Find the median age(one middle item or two middle items divided by two)
- Find the average age(all items divided by number of items) - Find the average age(all items divided by number of items)
- Find the range of the ages(max minus min) - Find the range of the ages(max minus min)
- Compare the value of (min - average) and (max - average), use *abs()* method - Compare the value of (min - average) and (max - average), use *abs()* method
1.Slice the first ten countries from the [countries array](https://github.com/Asabeneh/30DaysOfJavaScript/tree/master/data/countries.js) 1.Slice the first ten countries from the [countries array](https://github.com/Asabeneh/30DaysOfJavaScript/tree/master/data/countries.js)
1. Find the middle country(ies) in the [countries array](https://github.com/Asabeneh/30DaysOfJavaScript/tree/master/data/countries.js) 1. Find the middle country(ies) in the [countries array](https://github.com/Asabeneh/30DaysOfJavaScript/tree/master/data/countries.js)
1. Find the middle country(ies) in the [countries array](https://github.com/Asabeneh/30DaysOfJavaScript/tree/master/data/countries.js) 2. Divide the countries array into two equal arrays if it is even. If countries array is not even , one more country for the first half.
1. Divide the countries array into two equal arrays if it is even. If countries array is not even , one more country for the first half.
🎉 CONGRATULATIONS ! 🎉 🎉 CONGRATULATIONS ! 🎉

@ -690,7 +690,7 @@ console.log('Weight of an object in Newton: ', weightOfObject(100, 1.62)) // gra
1. Write a function called _isPrime_, which checks if a number is prime number. 1. Write a function called _isPrime_, which checks if a number is prime number.
1. Write a functions which checks if all items are unique in the array. 1. Write a functions which checks if all items are unique in the array.
1. Write a function which checks if all the items of the array are the same data type. 1. Write a function which checks if all the items of the array are the same data type.
1. JavaScript variable name does not support special characters or symbols except \$ or \_. Write a function **\*isValidVariable** which check if a variable is valid or invalid variable. 1. JavaScript variable name does not support special characters or symbols except \$ or \_. Write a function **isValidVariable** which check if a variable is valid or invalid variable.
1. Write a function which returns array of seven random numbers in a range of 0-9. All the numbers must be unique. 1. Write a function which returns array of seven random numbers in a range of 0-9. All the numbers must be unique.
```js ```js

@ -572,15 +572,12 @@ console.log(copyPerson.hasOwnProperty('score'))
] ]
``` ```
Imagine you are getting the above users collection from a MongoDB database. Imagine you are getting the above users collection from a MongoDB database.
a. Create a function called signUp which allows user to add to the collection. If user exists, inform the user that he has already an account.
a. Create a function called signUp which allows user to add to the collection. If user exists, inform the user that he has already an account. b. Create a function called signIn which allows user to sign in to the application
b. Create a function called signIn which allows user to sign in to the application
3. The products array has three elements and each of them has six properties. 3. The products array has three elements and each of them has six properties.
a. Create a function called rateProduct which rates the product
a. Create a function called rateProduct which rates the product b. Create a function called averageRating which calculate the average rating of a product
b. Create a function called averageRating which calculate the average rating of a product
4. Create a function called likeProduct. This function will helps to like to the product if it is not liked and remove like if it was liked. 4. Create a function called likeProduct. This function will helps to like to the product if it is not liked and remove like if it was liked.

@ -13,7 +13,7 @@
</sub> </sub>
</div> </div>
[<< Day 9](https://github.com/Asabeneh/30DaysOfJavaScript/blob/master/09_Day/09_day_higher_order_functions.md) | [Day 11>>](https://github.com/Asabeneh/30DaysOfJavaScript/blob/master/11_Day/11_destructuring_and_spreading.md) [<< Day 9](https://github.com/Asabeneh/30DaysOfJavaScript/blob/master/09_Day/09_day_higher_order_functions.md) | [Day 11>>](https://github.com/Asabeneh/30DaysOfJavaScript/blob/master/11_Day/11_destructuring_and_spread.md)
![Day 5](../images/banners/day_1_10.png) ![Day 5](../images/banners/day_1_10.png)
@ -438,4 +438,4 @@ const countries = ['Finland', 'Sweden', 'Norway']
🎉 CONGRATULATIONS ! 🎉 🎉 CONGRATULATIONS ! 🎉
[<< Day 9](https://github.com/Asabeneh/30DaysOfJavaScript/blob/master/09_Day/09_day_higher_order_functions.md) | [Day 11>>](https://github.com/Asabeneh/30DaysOfJavaScript/blob/master/11_Day/11_destructuring_and_spreading.md) [<< Day 9](https://github.com/Asabeneh/30DaysOfJavaScript/blob/master/09_Day/09_day_higher_order_functions.md) | [Day 11>>](https://github.com/Asabeneh/30DaysOfJavaScript/blob/master/11_Day/11_destructuring_and_spread.md)

Loading…
Cancel
Save