ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 127 - Certified JavaScript Developer I discussion

Report
Export

The developer wants to test this code:

Const toNumber =(strOrNum) => strOrNum;

Which two tests are most accurate for this code?

Choose 2 answers

A.
console.assert(toNumber('2') === 2);
Answers
A.
console.assert(toNumber('2') === 2);
B.
console.assert(Number.isNaN(toNumber()));
Answers
B.
console.assert(Number.isNaN(toNumber()));
C.
console.assert(toNumber('-3') < 0);
Answers
C.
console.assert(toNumber('-3') < 0);
D.
console.assert(toNumber () === NaN);
Answers
D.
console.assert(toNumber () === NaN);
Suggested answer: A, C
asked 23/09/2024
Darshak Ramdevputra
31 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first