Which two tests are the most accurate for this array?
The developer wants to test the array shown: const arr = Array(5).fill(0) Which two tests are the most accurate for this array? Choose 2 answers:A . console.assert( arr.length === 5 );B . arr.forEach(elem => console.assert(elem === 0)) ;C . console.assert(arr[0] === 0 && arr[ arr.length] === 0);D . console.assert (arr.length...
Why would a developer specify a package.jason as a developed forge instead of a dependency?
Why would a developer specify 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...
What is the output after the code executes?
Refer to the code below: Function Person(firstName, lastName, eyecolor) { this.firstName =firstName; this.lastName = lastName; this.eyeColor = eyeColor; } Person.job = ‘Developer’; const myFather = new Person(‘John’, ‘Doe’); console.log(myFather.job); What is the output after the code executes?A . ReferenceError: eyeColor is not definedB . ReferenceError: assignment to undeclared variable “Person”C...
Which three benefits of Node.js can the developer use to persuade their manager?
developer is trying to convince management that their team will benefit from using Node.js for a backend server that they are going to create. The server will be a web server that handles API requests from a website that the team has already built using HTML, CSS, and JavaScript. Which...
What needs to be done to make this code work as expected?
A developer creates a simple webpage with an input field. When a user enters text in the input field and clicks the button, the actual value of the field must be displayed in the console. Here is the HTML file content: <input type =” text” value=”Hello” name =”input”> <button type...
Which option allows the developer to step into each function execution within calculateBill?
A developer has code that calculates a restaurant bill, but generates incorrect answers while testing the code: function calculateBill ( items ) { let total = 0; total += findSubTotal(items); total += addTax(total); total += addTip(total); return total; } Which option allows the developer to step into each function execution...
How should this expression be modified to ensure that evaluates to false?
Refer to the expression below: Let x = (‘1’ + 2) == (6 * 2); How should this expression be modified to ensure that evaluates to false?A . Let x = (‘1’ + ‘ 2’) == ( 6 * 2);B . Let x = (‘1’ + 2) == ( 6...
Which three console logging methods allow the use of string substitution in line 02?
A developer creates a generic function to log custom messages in the console. To do this, the function below is implemented. 01 function logStatus(status){ 02 console./*Answer goes here*/{‘Item status is: %s’, status}; 03 } Which three console logging methods allow the use of string substitution in line 02?A . AssertB...
Which two test approaches describe the requirement?
A test has a dependency on database.query. During the test the dependency is replaced with an object called database with the method, query, that returns an array. The developer needs to verify how many times the method was called and the arguments used each time. Which two test approaches describe...
Which two methods are used to address this?
In the browser, the window object is often used to assign variables that require the broadest scope in an application Node.js application does not have access to the window object by default. Which two methods are used to address this? Choose 2 answersA . Use the document object instead of...