Get instant access to CRT-600 Practice Tests 2021 Free Updated Today!
Welcome to download the newest PassLeader CRT-600 PDF dumps ( 160 Q&As)
NEW QUESTION 46
Which two console logs outputs NaN ?
Choose 2 answers
- A. console.log(10/ ''five);
- B. console.log(10/0);
- C. console.log(parseInt('two'));
- D. console.log(10/ Number('5'));
Answer: A,C
NEW QUESTION 47
A developer is wondering whether to use, Promise.then or Promise.catch, especially when a Promise throws an error?
Which two promises are rejected?
Which 2 are correct?
- A. New Promise(() => (throw 'cool error here'}).then(null, error => console.error(error)));
- B. Promise.reject('cool error here').catch(error => console.error(error));
- C. New Promise((resolve, reject) => (throw 'cool error here'}).catch(error => console.error(error)) ;
- D. Promise.reject('cool error here').then(error => console.error(error));
Answer: B,C
NEW QUESTION 48
Refer to HTML below:
<p> The current status of an Order: <span id ="status"> In Progress </span> </p>.
Which JavaScript statement changes the text 'In Progress' to 'Completed' ?
- A. document.getElementById(".status").innerHTML = 'Completed' ;
- B. document.getElementById("status").Value = 'Completed' ;
- C. document.getElementById("status").innerHTML = 'Completed' ;
- D. document.getElementById("#status").innerHTML = 'Completed' ;
Answer: C
NEW QUESTION 49
A developer is setting up a new Node.js server with a client library that is built using events and callbacks.
The library:
* Will establish a web socket connection and handle receipt of messages to the server
* Will be imported with require, and made available with a variable called we.
The developer also wants to add error logging if a connection fails.
Given this info, which code segment shows the correct way to set up a client with two events that listen at execution time?
- A. try{
ws.connect (( ) => {
console.log('connected to client'); });
} catch(error) { console.log('ERROR' , error); };
} - B. ws.on ('connect', ( ) => { console.log('connected to client'); }}; ws.on('error', (error) => { console.log('ERROR' , error); }};
- C. ws.connect (( ) => {
console.log('connected to client'); }).catch((error) => { console.log('ERROR' , error); }}; - D. ws.on ('connect', ( ) => {
console.log('connected to client'); ws.on('error', (error) => { console.log('ERROR' , error); });
});
Answer: B
NEW QUESTION 50
Refer to the code below:
<html lang="en">
<table onclick="console.log(Table log');">
<tr id="row1">
<td>Click me!</td>
</tr>
<table>
<script>
function printMessage(event) {
console.log('Row log');
}
Let elem = document.getElementById('row1');
elem.addEventListener('click', printMessage, false);
</script>
</html>
Which code change should be made for the console to log only Row log when 'Click me! ' is clicked?
- A. Add.event.stopPropagation(); to window.onLoad event handler.
- B. Add event.stopPropagation(); to printMessage function.
- C. Add event.removeEventListener(); to window.onLoad event handler.
- D. Add event.removeEventListener(); toprintMessage function.
Answer: B
NEW QUESTION 51
What are two unique features of functions defined with a fat arrow as compared to normal function definition?
Choose 2 answers
- A. The function generated its own this making it useful for separating the function's scope from its enclosing scope.
- B. The function uses the this from the enclosing scope.
- C. If the function has a single expression in the function body, the expression will be evaluated and implicit returned.
- D. The function receives an argument that is always in scope, called parentThis, which is the enclosing lexical scope.
Answer: A,C
NEW QUESTION 52
Refer to the following code:
function test (val) {
If (val === undefined) {
return 'Undefined values!' ;
}
if (val === null) {
return 'Null value! ';
}
return val;
}
Let x;
test(x);
What is returned by the function call on line 13?
- A. 'Null value!'
- B. 'Undefined values!'
- C. Undefined
- D. Line 13 throws an error.
Answer: C
NEW QUESTION 53
A developer at Universal Containers creates a new landing page based on HTML, CSS, and JavaScript TO ensure that visitors have a good experience, a script named personaliseContext needs to be executed when the webpage is fully loaded (HTML content and all related files ), in order to do some custom initialization.
Which statement should be used to call personalizeWebsiteContent based on the above business requirement?
- A. window.addEventListener('load',personalizeWebsiteContext);
- B. window.addEventListener('onload', personalizeWebsiteContext);
- C. document.addEventListener(''onDOMContextLoaded', personalizeWebsiteContext);
- D. Document.addEventListener('''DOMContextLoaded' , personalizeWebsiteContext);
Answer: A
NEW QUESTION 54
Which two code snippets show working examples of a recursive function?
Choose 2 answers
- A. Const factorial =numVar => {
If (numVar < 0) return;
If ( numVar === 0 ) return 1;
return numVar * factorial ( numVar - 1 );
}; - B. Let countingDown = function(startNumber) {
If ( startNumber >0) {
console.log(startNumber) ;
return countingDown(startNUmber);
} else {
return startNumber;
}}; - C. Function factorial ( numVar ) {
If (numVar < 0) return;
If ( numVar === 0 ) return 1;
return numVar -1; - D. Const sumToTen = numVar => {
If (numVar < 0)
Return;
return sumToTen(numVar + 1)};
Answer: A,B
NEW QUESTION 55
Which option is a core Node,js module?
- A. locate
- B. Memory
- C. Path
- D. Ios
Answer: C
NEW QUESTION 56
A developer is leading the creation of a new browser application that will serve a single page application. The team wants to use a new web framework Minimalsit.js. The Lead developer wants to advocate for a more seasoned web framework that already has a community around it.
Which two frameworks should the lead developer advocate for?
Choose 2 answers
- A. Koa
- B. Vue
- C. Express
- D. Angular
Answer: C,D
NEW QUESTION 57
Refer to the following code:
Let sampleText = 'The quick brown fox jumps';
A developer needs to determine if a certain substring is part of a string.
Which three expressions return true for the given substring ?
Choose 3 answers
- A. sampleText.includes(' quick ', 4);
- B. sampleText.includes(' Fox ', 3)
- C. sampleText.includes(' quick ') !== -1;
- D. sampleText.includes(' fox ');
- E. sampleText.includes('fox');
Answer: A,C,D
NEW QUESTION 58
Refer to the following code:
<html lang="en">
<body>
<div onclick = "console.log('Outer message') ;">
<button id ="myButton">CLick me<button>
</div>
</body>
<script>
function displayMessage(ev) {
ev.stopPropagation();
console.log('Inner message.');
}
const elem = document.getElementById('myButton');
elem.addEventListener('click' , displayMessage);
</script>
</html>
What will the console show when the button is clicked?
- A. Inner message
Outer message - B. Outer message
Inner message - C. Inner message
- D. Outer message
Answer: C
NEW QUESTION 59
The developer has a function that prints "Hello" to an input name. To test this, thedeveloper created a function that returns "World". However the following snippet does not print " Hello World".
What can the developer do to change the code to print "Hello World" ?
- A. Change line 9 to sayHello(world) ();
- B. Change line 7 to ) () ;
- C. Change line 2 to console.log('Hello' , name() );
- D. Change line 5 to function world ( ) {
Answer: C
NEW QUESTION 60
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 ="button" >Display </button>
The developer wrote the javascript code below:
Const button = document.querySelector('button');
button.addEvenListener('click', () => (
Const input = document.querySelector('input');
console.log(input.getAttribute('value'));
When the user clicks the button, the output is always "Hello".
What needs to be done make this code work as expected?
- A. Replace line 04 with console.log(input .value);
- B. Replace line 02 with button.addEventListener("onclick", function() {
- C. Replace line 02 with button.addCallback("click", function() {
- D. Replace line 03 with const input = document.getElementByName('input');
Answer: A
NEW QUESTION 61
......
Sep-2021 Latest CertkingdomPDF CRT-600 Exam Dumps with PDF and Exam Engine: https://www.certkingdompdf.com/CRT-600-latest-certkingdom-dumps.html