Exam4Training

Which two tests are most accurate for this code?

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);
B . console.assert(Number.isNaN(toNumber()));
C . console.assert(toNumber(‘-3’) < 0);
D . console.assert(toNumber () === NaN);

Answer: A,C

Exit mobile version