Question 36
At Universal Containers, every team has its own way of copying JavaScript objects. The code Snippet shows an implementation from one team:
Function Person() {
this.firstName = "John";
this.lastName = 'Doe';
This.name =() => (
console.log('Hello $(this.firstName) $(this.firstName)');
)}
Const john = new Person ();
Const dan = JSON.parse(JSON.stringify(john));
dan.firstName ='Dan';
dan.name();
What is the Output of the code execution?
Function Person() {
this.firstName = "John";
this.lastName = 'Doe';
This.name =() => (
console.log('Hello $(this.firstName) $(this.firstName)');
)}
Const john = new Person ();
Const dan = JSON.parse(JSON.stringify(john));
dan.firstName ='Dan';
dan.name();
What is the Output of the code execution?
Question 37
A developer wants to set up a secure web server with Node.js. The developer creates a
directory locally called app-server, and the first file is app-server/index.js
Without using any third-party libraries, what should the developer add to index.js to create the
secure web server?
directory locally called app-server, and the first file is app-server/index.js
Without using any third-party libraries, what should the developer add to index.js to create the
secure web server?
Question 38
A developer is asked to fix some bugs reported by users. To do that, the developer adds a breakpoint for debugging.
Function Car (maxSpeed, color){
This.maxspeed =masSpeed;
This.color = color;
Let carSpeed = document.getElementById(' CarSpeed');
Debugger;
Let fourWheels =new Car (carSpeed.value, 'red');
When the code execution stops at the breakpoint on line 06, which two types of information are available in the browser console ?
Choose 2 answers:
Function Car (maxSpeed, color){
This.maxspeed =masSpeed;
This.color = color;
Let carSpeed = document.getElementById(' CarSpeed');
Debugger;
Let fourWheels =new Car (carSpeed.value, 'red');
When the code execution stops at the breakpoint on line 06, which two types of information are available in the browser console ?
Choose 2 answers:
Question 39
Which function should a developer use to repeatedly execute code at a fixed time interval?
Question 40
Refer to the code below:
For (let number =2: number <= S; number += 1) ( // insert code statement here The developer needs to insert a code statement in the location shown. The code statement has these requirements:
1. Does not require an import
2. Logs an error when the Boolean statement evaluates to false
3. Works In both the browser and Node.js
Which statement meet these requirements?
For (let number =2: number <= S; number += 1) ( // insert code statement here The developer needs to insert a code statement in the location shown. The code statement has these requirements:
1. Does not require an import
2. Logs an error when the Boolean statement evaluates to false
3. Works In both the browser and Node.js
Which statement meet these requirements?
