Q1. Refer to the string below: const str = 'Salesforce'; Which two statements result in the word 'Sales'?
A.str.substr(1, 5);
B. str.substr (0, 5);
C. str.substring (1, 5);
D. str.substring (0, 5);
Correct Answer: B, D
Q2. GIven a value, which three options can a developer use to detect if thevalue is NaN? Choose 3 answers !
A.value == NaN
B. Object.is(value, NaN)
C. value === Number.NaN
D. value ! == value
E. Number.isNaN(value)
Answer: A,E
Q3. A developer has the following array of hourly wages: Let arr = (8, 5, 9, 75, 11, 25, 7, 75, , 13, 25); For workers making less than $10 an hour rate should be multiple by 1.25 and returned in a new array. How should the developer implement the request?
A.let arrl = arr.filter((val) => val num = 1.25);
B. let arrl = arr .rr.acArray ((val) => ( val { num * 1.25 ));
C. let arrl = arr-map((num) => { return ran * 1.25 }).filter((val) -> { return val < 10));
D. let arrl = arr.filterBy((val) => val < 10 ).aapBy num = ..25 );
Answer: C
Q4. A developer wants to define a function log to be used a few times on a single-file JavaScript script. 01 // Line 1 replacement 02 console.log('"LOG:', logInput); 03 } Which two options can correctly replaceline 01 and declare the function for use? Choose 2 answers
A.function leg(logInput) {
B. const log(loginInput) {
C. const log = (logInput) => {
D. function log = (logInput) {
Answer: A,C
Q5. Given the code below: FunctionmyFunction(){ A =5; Var b =1; } myFunction(); console.log(a); console.log(b); What is the expected output?
A.Both lines 08 and 09 are executed, and the variables are outputted.
B. Line 08 outputs the variable, but line 09 throws an error.
C. Line 08thrones an error, therefore line 09 is never executed.
D. Both lines 08 and 09 are executed, but values outputted are undefined.
Answer: B
$ 39
Reviews
There are no reviews yet.