Skip to content

Commit d7b0f97

Browse files
committed
adding tricky js Questions collection
1 parent cbc0387 commit d7b0f97

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

Javascript/Tricky-JS-Problems/Collection-of-Tricky-JS-Questlions.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,10 @@
5050

5151
**Answer**: 12.3
5252

53-
#### Question: What is the value of `Math.max([2,3,4,5]);`
54-
55-
Answer: NaN
56-
5753
#### Question: What is value of `3 instanceof Number`
5854

59-
Answer: false
55+
**Answer**: false
6056

6157
#### Question:null == undefined
6258

63-
Answer: true
59+
**Answer**: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#### Question: What is the value of `Math.max([2,3,4,5]);`
2+
3+
Answer: NaN
4+
5+
#### Explanations
6+
7+
Because `max()` is a static method of Math, you always use it as `Math.max()`, rather than as a method of a Math object you created (Math is not a constructor).
8+
9+
If no arguments are given, the result is -Infinity.
10+
11+
If at least one of arguments cannot be converted to a number, the result is NaN.
12+
13+
When you call Math.max with array parameter like
14+
15+
```
16+
Math.max([1,2,3])
17+
18+
```

0 commit comments

Comments
 (0)