Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dba880b

Browse files
authored
Update MAKEME.md
comments, solutions to these questions.
1 parent 2f15f11 commit dba880b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Week1/MAKEME.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,17 @@ Write commands to do following:
3636

3737
2. How do you round the number 7.25, to the nearest integer?
3838

39+
currnum = 5.49999999999999955 ;
40+
41+
if (currnum % 1 >= 0.5) {
42+
43+
console.log (currnum - currnum % 1 + 1) ;
44+
}
45+
else {
46+
47+
console.log (currnum - currnum % 1) ;
48+
}
49+
3950
3. Create a array called `colors` with the strings red, green and blue inside.
4051

4152
4. How can you find the length of the string you just created?
@@ -54,10 +65,18 @@ For example:
5465

5566
6. If `x` equals 7, and the only other statement is `x = x % 3`, what would be the new value of `x`?
5667

68+
let x = 7 ;
69+
x = x % 3 ;
70+
console.log (x) ;
71+
1
72+
5773
7. Write a program to answer the following questions:
5874
* Can you store multiple types in an array? Numbers and strings?
5975
* Can you compare inifities? (Not in Eyad's world) - does 6/0 == 10/0? How can you test this?
6076

77+
6 / 0 == -6 / -0 == Infinity == Number.POSITIVE_INFINITY
78+
-6 / 0 == 6 / -0 == -6 / 0 == Number.NEGATIVE_INFINITY
79+
6180
### Step 3: **Some freeCodeCamp challenges (10 hours):**
6281

6382
On freeCodeCamp.com please do the [Basic JavaScript](https://www.freecodecamp.com/challenges/learn-how-free-code-camp-works) exercises up and until the __"Shopping List"__ exercise (there are some topics we did not cover but you can do it).

0 commit comments

Comments
 (0)