Skip to content

Commit 221a968

Browse files
committed
question added
1 parent c2bb4b6 commit 221a968

1 file changed

Lines changed: 24 additions & 26 deletions

File tree

readMe.md

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ Output:
116116
I am 25 years old.
117117
You are 30 years old.
118118
```
119-
120119
## Comments
121120
Commenting in JavaScript is similar to other programming languages. Comments can help to make code more readable.
122121
There are two ways of commenting:
@@ -217,33 +216,31 @@ const PI = 3.14;// constant
217216
const boilingPoint = 100; // oC, boiling point of water
218217
var bodyTemp = 37; // oc body temperature
219218
console.log(age, gravity, mass, PI, boilingPoint,bodyTemp)
220-
221219
```
222220
### Booleans
223221
Boolean value is either true or false. Any comparisons return a boolean value which is either true or false.
224222
```js
225223
let isRaining = false
226224
let hungery = false;
227225
let isMarried = true;
228-
229226
```
230227
#### Exercise : Booleans
231228
Boolean value is either true or false.
232229
1. Write three JavaScript statement which provide truthy value.
233230
1. Write three JavaScript statement which provide falsy value.
234231
1. Use all the following comparison operators to compare the following values: >, < >=, <=, !=, !==,===.
235-
Which are true or which are false ?
236-
1. 4 > 3
237-
1. 4 >= 3
238-
1. 4 < 3
239-
1. 4 <= 3
240-
1. 4 == 4
241-
1. 4 === 4
242-
1. 4 != 4
243-
1. 4 !== 4
244-
1. 4 != '4'
245-
1. 4 == '4'
246-
1. 4 === '4'
232+
Which are true or which are false ?
233+
1. 4 > 3
234+
1. 4 >= 3
235+
1. 4 < 3
236+
1. 4 <= 3
237+
1. 4 == 4
238+
1. 4 === 4
239+
1. 4 != 4
240+
1. 4 !== 4
241+
1. 4 != '4'
242+
1. 4 == '4'
243+
1. 4 === '4'
247244

248245
### Undefined
249246
```js
@@ -410,7 +407,6 @@ console.log(webTechs[webTechs.length-1]) //--> MongoDB
410407
console.log(countries);
411408
console.log(numbers);
412409
console.log(shoppingCart)
413-
414410
```
415411
#### Exercises:Arrays
416412
1. Declare an array variable name itCompanies and assign initial values Facebook, Google, Microsoft, Apple, IBM, Oracle and Amazon.
@@ -437,7 +433,6 @@ console.log(modifyArray(["Google", "Facebook","Apple", "Amazon","Microsoft", "I
437433
// →["Google", "Facebook","Apple", "Amazon","MICROSOFT", "IBM"]
438434
console.log(modifyArray(["Google", "Facebook","Apple", "Amazon"]);
439435
// →"Not Found"
440-
441436
```
442437
443438
## Conditionals
@@ -455,7 +450,6 @@ if (isRaining) {
455450
```js
456451
if(condition){
457452
// if the condition met
458-
459453
} else{
460454
// if condition doesn't met
461455
}
@@ -534,7 +528,6 @@ Another way to write conditionals is using ternary operators.
534528
```js
535529
let isRaining = true;
536530
isRaining ? console.log('You need a rain coat.') : console.log('No need for a rain coat.')
537-
538531
```
539532
#### Exercises:Flow Control
540533
- Get user input using prompt(“Enter your age:”). If user is 18 or older , give feedback:You are old enough to drive but if not 18 give feedback to wait for the years he supposed to wait for.
@@ -603,13 +596,13 @@ do {
603596
1. Use for loop to iterate from 0 to 100 and print only even numbers
604597
1. Use for loop to iterate from 0 to 100 and print only odd numbers
605598
1. Use for loop to iterate from 0 to 100 and print and print the sum of all numbers.
606-
```js
607-
The sum all numbers is 5050.
608-
```
599+
```js
600+
The sum all numbers is 5050.
601+
```
609602
1. Use for loop to iterate from 0 to 100 and print the sum of all evens and the sum of all odds.
610-
```js
611-
The sum of all evens is 2550. And the sum of all odds is 2500.
612-
```
603+
```js
604+
The sum of all evens is 2550. And the sum of all odds is 2500.
605+
```
613606
614607
## Functions
615608
A function is a block of code designed to perform a certain task.
@@ -787,11 +780,16 @@ const square = n => n * n; // -> 4
787780
rgb(125,244,255)
788781
```
789782
1. Write a function name *displayDateTime* and it display in this format: 28/08/2018 04:08
790-
1. Use the new Date() object to get month, date, year, hour and minute.
783+
1. Use the new Date() object to get *month, date, year, hour* and *minute*.
791784
Output:
792785
```sh
793786
28/08/2018 04:08
794787
```
788+
1. Call your function *shuffleArray*, it takes an array as a parameter and it returns a shuffled array
789+
1. Call your function *factorial*, it takes a whole number as a parameter and it return a factorial of the number
790+
1. Call your function *isEmpty*, it takes a parameter and it checks if it is empty or not
791+
1. Call your function *sum*, it takes any number of arguments and it returns the sum.
792+
795793
## Object
796794
Everything can be an object and objects do have properties and properties have values.
797795
```js

0 commit comments

Comments
 (0)