restructuring

pull/33/head
Asabeneh 5 years ago
parent 5a95f04fb0
commit cccf0203cc

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

@ -4,7 +4,7 @@
[<< Day 1](https://github.com/Asabeneh/30DaysOfJavaScript/blob/master/readMe.md) | [Day 3 >>](https://github.com/Asabeneh/30DaysOfJavaScript/blob/master/03_Day/03_booleans_operators_date.md)
--
![Thirty Days Of JavaScript](./day_1_2.png)
![Thirty Days Of JavaScript](../images/banners/day_1_2.png)
- [📔 Day 2](#%f0%9f%93%94-day-2)
- [Data types](#data-types)

@ -3,7 +3,7 @@
[<< Day 2](https://github.com/Asabeneh/30DaysOfJavaScript/blob/master/02_Day/02_day_data_types.md) | [Day 4 >>](https://github.com/Asabeneh/30DaysOfJavaScript/blob/master/04_Day/04_day_conditionals.md)
--
![Thirty Days Of JavaScript](./day_1_3.png)
![Thirty Days Of JavaScript](../images/banners/day_1_3.png)
- [📔 Day 3](#%f0%9f%93%94-day-3)
- [Booleans](#booleans)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

@ -3,7 +3,7 @@
[<< Day 3](https://github.com/Asabeneh/30DaysOfJavaScript/blob/master/03_Day/03_booleans_operators_date.md) | [Day 5 >>](https://github.com/Asabeneh/30DaysOfJavaScript/blob/master/05_Day/05_day_arrays.md)
--
![Thirty Days Of JavaScript](./day_1_4.png)
![Thirty Days Of JavaScript](../images/banners/day_1_4.png)
- [📔 Day 4](#%f0%9f%93%94-day-4)
- [Conditionals](#conditionals)
@ -193,9 +193,11 @@ switch (weather) {
default:
console.log(' No need for rain coat.')
}
// Switch More Examples
var dayUserInput = prompt('What day is today ?')
var day = dayUserInput.toLowerCase()
let dayUserInput = prompt('What day is today ?')
let day = dayUserInput.toLowerCase()
switch (day) {
case 'monday':
console.log('Today is Monday')
@ -218,10 +220,10 @@ switch (day) {
case 'sunday':
console.log('Today is Sunday')
break
default:
console.log('It is not a week day.')
}
```
### Ternary Operators

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

@ -167,6 +167,7 @@ console.log(lastFruit) // lemon
let lastIndex = fruits.length - 1
lastFruit = fruits[lastIndex]
console.log(lastFruit) // lemon
```
@ -328,9 +329,9 @@ console.log(thirdList) // [1, 2, 3, 4, 5, 6]
```
```js
const fruits = ['banana', 'orange', 'mango', 'lemon'] // array of fruits
const fruits = ['banana', 'orange', 'mango', 'lemon'] // array of fruits
const vegetables = ['Tomato', 'Potato', 'Cabbage', 'Onion', 'Carrot'] // array of vegetables
const fruitsAndVegetables = fruits.concat(vegetables) // concatinate the two arrays
const fruitsAndVegetables = fruits.concat(vegetables) // concatenate the two arrays
console.log(fruitsAndVegetables)
```
@ -382,7 +383,7 @@ if(index != -1){
index != -1 ? console.log('This fruit does exist in the array'): console.log('This fruit does not exist in the array')
// let us check if a avocado exist in the array
let indexOfAvocado = fruits.indexOf('avocado') // -1
let indexOfAvocado = fruits.indexOf('avocado') // -1, if the element not found index is -1
if(indexOfAvocado!= -1){
console.log('This fruit does exist in the array')
} else {

Loading…
Cancel
Save