NEW QUESTION # 170
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('-3') < 0);
- B. console.assert(toNumber () === NaN);
- C. console.assert(Number.isNaN(toNumber()));
- D. console.assert(toNumber('2') === 2);
NEW QUESTION # 171
Refer to the code below:
let productSKU = '8675309,;
A developer has a requirement to generate SKU numbers that are always 10 characters log, starting with 'sku', and padded with zeros.
Which statement assigned the value skuooooooooo86675309?
- A. productSKU = productSKU. Padstart (16, '0' padstart (19, 'sku') ;
- B. productSKU = productSKU. Padstart (19, '0' padstart ('sku') ;
- C. productSKU = productSKU. PadEnd (16, '0' padstart (19, 'sku') ;
- D. productSKU = productSKU. PadEnd (16, '0' padstart ('sku') ;
NEW QUESTION # 172
Which code should replace the placeholder comment on line 05 to highlight accounts that match the search string'
- A. 'yellow' : null
- B. 'none1 : "yellow'
- C. 'yellow : 'none'
- D. null : 'yellow'
NEW QUESTION # 173
A developer has the following array of student test grades:
Let arr = [ 7, 8, 5, 8, 9 ];
The Teacher wants to double each score and then see an array of the students
who scored more than 15 points.
How should the developer implement the request?
- A. Let arr1 = arr.filter(( val) => ( return val > 15 )) .map (( num) => ( return num *2 ))
- B. Let arr1 = arr.mapBy (( num) => ( return num *2 )) .filterBy (( val ) => return val > 15 )) ;
- C. Let arr1 = arr.map((num) => num*2). Filter (( val) => val > 15);
- D. Let arr1 = arr.map((num) => ( num *2)).filterBy((val) => ( val >15 ));
NEW QUESTION # 174
A developer writes the code below to return a message to a user attempting to register a new username. If the username is available, a variable named nag is declared and assigned a value on line 03.
What is the value of msg when getAvailableabilityMessage ("newUserName") is executed and get Availability ("newUserName") returns true?
- A. "newUserName"
- B. undefined
- C. "User-name available"
- D. "msg is not defined"
NEW QUESTION # 175