
CRT-600 Exam Dumps Pass with Updated Feb-2022 Tests Dumps
CRT-600 exam questions for practice in 2022 Updated 160 Questions
NEW QUESTION 45
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.on ('error', (error) => {
console.log('ERROR', error);
}); - B. Server.error ((server) => {
console.log('ERROR', error);
}); - C. Server.catch ((server) => {
console.log('ERROR', error);
}); - D. Try{
server.start();
} catch(error) {
console.log('ERROR', error);
}
Answer: A
NEW QUESTION 46
In which situation should a developer include a try .. catch block around their function call ?
- A. The function might raise a runtime error that needs to be handled.
- B. The function contains scheduled code.
- C. The function has an error that should not be silenced.
- D. The function results in an out of memory issue.
Answer: A
NEW QUESTION 47
Which function should a developer use to repeatedly execute code at a fixed interval ?
- A. setTimeout
- B. setIntervel
- C. setPeriod
- D. setInteria
Answer: B
NEW QUESTION 48
Given the following code:
Counter = 0;
const logCounter = () => {
console.log(counter);
);
logCounter();
setTimeout(logCOunter, 1100);
setInterval(() => {
Counter++
logCounter();
}, 1000);
What is logged by the first four log statements?
- A. 0 1 2 2
- B. 0 0 1 2
- C. 0 1 1 2
- D. 0 1 2 3
Answer: C
NEW QUESTION 49
A developer is required to write a function that calculates the sum of elements in an array but is getting undefined every time the code is executed. The developer needs to find what is missing in the code below.
Const sumFunction = arr => {
Return arr.reduce((result, current) => {
//
Result += current;
//
), 10);
);
Which option makes the code work as expected?
- A. Replace line 02 with return arr.map(( result, current) => (
- B. Replace line 04 with result = result +current;
- C. Replace line 05 with return result;
- D. Replace line 03 with if(arr.length == 0 ) ( return 0; )
Answer: C
NEW QUESTION 50
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 / 2);
- C. Let x = (1 + 2) == ( '6' / 2);
- D. Let x = ('1' + 2) == ( 6 * 2);
Answer: D
NEW QUESTION 51
Refer to the following code that imports a module named utils:
import (foo, bar) from '/path/Utils.js';
foo() ;
bar() ;
Which two implementations of Utils.js export foo and bar such that the code above runs without error?
Choose 2 answers
- A. const foo = () => { return 'foo';}
const bar = () => {return 'bar'; }
Export default foo, bar; - B. // FooUtils.js and BarUtils.js exist
Import (foo) from '/path/FooUtils.js';
Import (boo) from ' /path/NarUtils.js'; - C. Export default class {
foo() { return 'foo' ; }
bar() { return 'bar' ; }
} - D. const foo = () => { return 'foo' ; }
const bar = () => { return 'bar' ; }
export { bar, foo }
Answer: C,D
NEW QUESTION 52
Refer to code below:
Const objBook = {
Title: 'Javascript',
};
Object.preventExtensions(objBook);
Const newObjBook = objBook;
newObjectBook.author = 'Robert';
What are the values of objBook and newObjBook respectively ?
- A. {author: "Robert"}
{author: "Robert", title: "javaScript} - B. [title: "javaScript"] [title: "javaScript"]
- C. {author: "Robert", title: "javaScript}
{author: "Robert", title: "javaScript} - D. {author: "Robert", title: "javaScript}
Undefined
Answer: B
NEW QUESTION 53
A developer wrote a fizzbuzz function 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 neither 3 or 5.
Which two test cases will properly test scenarios for the fizzbuzz function?
Choose 2 answers
- A. let res = fizzbuzz(15);
console.assert ( res === ' fizzbuzz ' ) - B. let res = fizzbuzz(3);
console.assert ( res === ' buzz ' ) - C. let res = fizzbuzz(5);
console.assert ( res === ' ' ); - D. let res = fizzbuzz(Infinity);
console.assert ( res === ' ' )
Answer: A,B,D
NEW QUESTION 54
Refer to the following array:
Let arr = [ 1,2, 3, 4, 5];
Which three options result in x evaluating as [3, 4, 5] ?
Choose 3 answers.
- A. Let x= arr.filter((a) => ( return a>2 ));
- B. Let x= arr.splice(2,3);
- C. Let x= arr.slice(2);
- D. Let x = arr.slice(2,3);
- E. Let x= arr.filter (( a) => (a<2));
Answer: A,B,C
NEW QUESTION 55
developer publishes a new version of a package with new features that do not break backward compatibility. The previous version number was 1.1.3.
Following semantic versioning format, what should the new package version number be?
- A. 2.0.0
- B. 1.2.0
- C. 1.1.4
- D. 1.2.3
Answer: B
NEW QUESTION 56
Refer to the following code:
Let obj ={
Foo: 1,
Bar: 2
}
Let output =[],
for(let something in obj{
output.push(something);
}
console.log(output);
What is the output line 11?
- A. ["bar","foo"]
- B. ["foo","bar"]
- C. [1,2]
- D. ["foo:1","bar:2"]
Answer: B
NEW QUESTION 57
Refer to the following object:
const cat ={
firstName: 'Fancy',
lastName: ' Whiskers',
Get fullName() {
return this.firstName + ' ' + this.lastName;
}
};
How can a developer access the fullName property for cat?
- A. cat.fullName
- B. cat.function.fullName()
- C. cat.fullName()
- D. cat.get.fullName
Answer: A
NEW QUESTION 58
A class was written to represent items for purchase in an online store, and a second class Representing items that are on sale at a discounted price. THe constructor sets the name to the first value passed in. The pseudocode is below:
Class Item {
constructor(name, price) {
... // Constructor Implementation
}
}
Class SaleItem extends Item {
constructor (name, price, discount) {
...//Constructor Implementation
}
}
There is a new requirement for a developer to implement a description method that will return a brief description for Item and SaleItem.
Let regItem =new Item('Scarf', 55);
Let saleItem = new SaleItem('Shirt' 80, -1);
Item.prototype.description = function () { return 'This is a ' + this.name; console.log(regItem.description()); console.log(saleItem.description()); SaleItem.prototype.description = function () { return 'This is a discounted ' + this.name; } console.log(regItem.description()); console.log(saleItem.description()); What is the output when executing the code above ?
- A. This is a Scarf
This is a Shirt
This is a discounted Scarf
This is a discounted Shirt - B. This is a Scarf
Uncaught TypeError: saleItem.description is not a function
This is aScarf
This is a discounted Shirt - C. This is a Scarf
This is a Shirt
This is a Scarf
This is a discounted Shirt - D. This is aScarf
Uncaught TypeError: saleItem.description is not a function
This is a Shirt
This is a did counted Shirt
Answer: C
NEW QUESTION 59
Refer to the code below:
Let str = 'javascript';
Str[0] = 'J';
Str[4] = 'S';
After changing the string index values, the value of str is 'javascript'. What is the reason for this value:
- A. Primitive values are mutable.
- B. Non-primitive values are immutable.
- C. Non-primitive values are mutable.
- D. Primitive values are immutable.
Answer: D
NEW QUESTION 60
Given the JavaScript below:
01 function filterDOM (searchString) {
02 const parsedSearchString = searchString && searchString.toLowerCase() ;
03 document.quesrySelectorAll(' .account' ) . forEach(account => (
04 const accountName = account.innerHTML.toLOwerCase();
05 account. Style.display = accountName.includes(parsedSearchString) ? /*Insert code*/;
06 )};
07 }
Which code should replace the placeholder comment on line 05 to hide accounts that do not match the search string?
- A. ' hidden ' : ' visible '
- B. ' Block ' : ' none '
- C. ' name ' : ' block '
- D. ' visible ' : ' hidden '
Answer: B
NEW QUESTION 61
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 answers
- A. Assign variables to module.exports and require them as needed.
- B. Create a new window object in the root file.
- C. Use the document object instead of the window object.
- D. Assign variables to the global object.
Answer: D
NEW QUESTION 62
......
Salesforce CRT-600 Exam Syllabus Topics:
| Topic | Details |
|---|---|
| Topic 1 |
|
| Topic 2 |
|
| Topic 3 |
|
| Topic 4 |
|
| Topic 5 |
|
| Topic 6 |
|
Authentic CRT-600 Dumps With 100% Passing Rate Practice Tests Dumps: https://vcetorrent.passreview.com/CRT-600-exam-questions.html