Given the following code: What will be the first four numbers logged?
A. 0012
B. 0112
C. 0122
D. 0123
Which statement can a developer apply to increment the browser's navigation history without a page refresh?
A. window.history.pushState(newStateObject);
B. window.history.pushStare(newStateObject, ' ', null);
C. window.history.replaceState(newStateObject,' ', null);
D. window.history.state.push(newStateObject);
Why would a developerspecify a package.jason as a developed forge instead of a dependency?
A. It is required by the application in production.
B. It is only needed for local development and testing.
C. Other required packages depend on it for development.
D. It should be bundled when the package is published.
Refer to code below:
Let productSKU = `8675309' ;
A developer has a requirement to generate SKU numbers that are always 19 characters lon,
starting with `sku', and padded with zeros.
Which statement assigns the values sku0000000008675309 ?
A. productSKU = productSKU .padStart (19. `0').padstart(`sku');
B. productSKU = productSKU .padEnd (16. `0').padstart(`sku');
C. productSKU = productSKU .padEnd (16. `0').padstart(19, `sku');
D. productSKU = productSKU .padStart (16. `0').padstart(19, `sku');
Which statement accurately describes an aspect of promises?
A. Arguments for the callback function passed to .then() are optional.
B. In a.then()function, returning results is not necessary since callbacks will catch the result of a previous promise.
C. .then() cannot be added after a catch.
D. .then() manipulates and returns the original promise.
A developer implements a function that adds a few values.
Function sum(num) {
If (num == undefined) {
Num =0;
}
Return function( num2, num3){
If (num3 ===undefined) {
Num3 =0 ;
}
Return num + num2 + num3;
}
}
Which three options can the developer invoke for this function to get a return value of 10? Choose 3 answers
A. Sum () (20)
B. Sum (5, 5) ()
C. sum() (5, 5)
D. sum(5)(5)
E. sum(10) ()
Given two expressions var1 and var2. What are two valid ways to return the logical AND of the two expressions and ensure it is data type Boolean?
Choose 2 answers:
A. Boolean(var1 andand var2)
B. var1 andand var2
C. var1.toBoolean() andand var2toBoolean()
D. Boolean(var1) andand Boolean(var2)
Developer creates a new web server that uses Node.js. It imports a server library that uses events and callbacks for handling server functionality.
The server library is imported with require and is made available to the code by a variable named server. The developer wants to log any issues that the server has while booting up.
Given the code and the information the developer has, which code logs an error at boost with an event?
A. Server.catch ((server) => { console.log(`ERROR', error); });
B. Server.error ((server) => { console.log(`ERROR', error); });
C. Server.on (`error', (error) => { console.log(`ERROR', error); });
D. Try{ server.start(); } catch(error) { console.log(`ERROR', error); }
A developer wrote a fizzbuzzfunction that when passed in a number, returns the following:
`Fizz' if the number is divisible by 3.
`Buzz' if the number is divisible by 5.
`Fizzbuzz' if the number is divisible by both 3 and 5.
Empty string if the number is divisible by neither3 or 5.
Which two test cases will properly test scenarios for the fizzbuzz function?
Choose 2 answers
A. let res = fizzbuzz(5); console.assert ( res === ` ' );
B. let res = fizzbuzz(15); console.assert ( res === ` fizzbuzz ' )
C. let res = fizzbuzz(Infinity); console.assert ( res === ` ' )
D. let res = fizzbuzz(3); console.assert ( res === ` buzz ' )
Refer to the following code:
Which two statement could be inserted at line 17 to enable the function call on line 18? Choose 2 answers
A. Object.assign (leo, tony);
B. Object.assign (leo. Tiger);
C. leo.roar = () => { console.log('They\'re pretty good!'););
D. leo.prototype.roar = ( ) =>( console.log('They\'re pretty good!'); };