- A var num = 10;
- B var num = Number(10);
- C var num = new Number(10);
- D var num = 10.5;
- Share this MCQ
Answer:
C
Share this MCQ
While A, B, D, and E are all valid ways to create a new number in JavaScript, using the "new"
keyword and the Number constructor function (as in C) is not recommended,
because it can cause confusion with the primitive number data type.
It is better to use either of the other options.
Share this MCQ