CRT-600 Exam Brain Dumps - Study Notes and Theory [Feb-2023]
100% Guaranteed Results CRT-600 Unlimited 225 Questions
NEW QUESTION 62
Which code statement below correctly persists an objects in local Storage ?
- A. const setLocalStorage = ( jsObject) => {
window.localStorage.setItem(jsObject);
} - B. const setLocalStorage = (storageKey, jsObject) => {
window.localStorage.setItem(storageKey, JSON.stringify(jsObject));
} - C. const setLocalStorage = ( jsObject) => {
window.localStorage.connectObject(jsObject));
} - D. const setLocalStorage = (storageKey, jsObject) => {
window.localStorage.persist(storageKey, jsObject);
}
Answer: B
NEW QUESTION 63
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 02 with button.addCallback("click", function() {
- B. Replace line 02 with button.addEventListener("onclick", function() {
- C. Replace line 03 with const input = document.getElementByName('input');
- D. Replace line 04 with console.log(input .value);
Answer: D
NEW QUESTION 64
Refer to the code below:
01 const exec = (item, delay) =>{
02 new Promise(resolve => setTimeout( () => resolve(item), delay)),
03 async function runParallel() {
04 Const (result1, result2, result3) = await Promise.all{
05 [exec ('x', '100') , exec('y', 500), exec('z', '100')]
06 );
07 return `parallel is done: $(result1) $(result2)$(result3)`;
08 }
}
}
Which two statements correctly execute the runParallel () function?
Choose 2 answers
- A. runParallel () .then(data);
- B. Async runParallel () .then(data);
- C. runParallel ( ). done(function(data){
return data;
}); - D. runParallel () .then(function(data)
return data
Answer: C,D
NEW QUESTION 65
Which code statement correctly retrieves and returns an object from localStorage?
- A. const retrieveFromLocalStorage = (storageKey) =>{
return window.localStorage[storageKey];
} - B. const retrieveFromLocalStorage = (storageKey) =>{
return JSON.parse(window.localStorage.getItem(storageKey));
} - C. const retrieveFromLocalStorage = (storageKey) =>{
return window.localStorage.getItem(storageKey);
} - D. const retrieveFromLocalStorage = () =>{
return JSON.stringify(window.localStorage.getItem(storageKey));
}
Answer: B
NEW QUESTION 66
Refer to the code below:
Const myFunction = arr => {
Return arr.reduce((result, current) =>{
Return result = current;
}, 10};
}
What is the output of this function when called with an empty array ?
- A. Returns 10
- B. Returns NaN
- C. Throws an error
- D. Returns 0
Answer: A
NEW QUESTION 67
A developer needs to test this function:
01 const sum3 = (arr) => (
02 if (!arr.length) return 0,
03 if (arr.length === 1) return arr[0],
04 if (arr.length === 2) return arr[0] + arr[1],
05 return arr[0] + arr[1] + arr[2],
06 );
Which two assert statements are valid tests for the function?
Choose 2 answers
- A. console.assert(sum3('hello', 2, 3, 4)) === NaN);
- B. console.assert(sum3(-3, 2 )) == -1);
- C. console.assert(sum3(1, '2')) == 12);
- D. console.assert(sum3(0)) == 0);
Answer: B,C
NEW QUESTION 68
Refer to the code below:
const car = {
price:100,
getPrice:function(){
return this.price;
}
};
const customCar = Object.create(car);
customCar.price = 70;
delete customCar.price;const result = customCar.getPrice();
What is the value of result after the code executes?
- A. null
- B. 0
- C. 1
- D. undefined
Answer: C
NEW QUESTION 69
A test has a dependency on database. query. During the test, the dependency is replaced with an object called database with the method, Calculator query, that returns an array. The developer does not need to verify how many times the method has been called.
Which two test approaches describe the requirement?
Choose 2 answers
- A. White box
- B. Substitution
- C. Black box
- D. Stubbing
Answer: A,B
NEW QUESTION 70
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. Promise.reject('cool error here').catch(error => console.error(error));
- B. New Promise(() => (throw 'cool error here'}).then(null, 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: A,C
NEW QUESTION 71
A developer has an ErrorHandler module that contains multiple functions.
What kind of export should be leveraged so that multiple functions can be used?
- A. named
- B. default
- C. all
- D. multi
Answer: A
NEW QUESTION 72
A developer is debugging a web server that uses Node.js The server hits a runtimeerror every third request to an important endpoint on the web server.
The developer added a break point to the start script, that is at index.js at he root of the server's source code. The developer wants to make use of chrome DevTools to debug.
Which command can be run to access DevTools and make sure the breakdown is hit ?
- A. node -i index.js
- B. Node inspect index.js
- C. Node --inspect index.js
- D. Node --inspect-brk index.js
Answer: C
NEW QUESTION 73
Refer the following code
what is the value of array after code executes?
- A. [ 1, 2, 3, 5 ]
Answer: A
NEW QUESTION 74
Given the following code:
let x = null;
console.log(typeof x);
What is the output?
- A. "x"
- B. "object"
- C. "null"
- D. "undefined"
Answer: B
NEW QUESTION 75
Given the following code:
document.body.addEventListener(' click ', (event) => {
if (/* CODE REPLACEMENT HERE */) {
console.log('button clicked!');
)
});
Which replacement for the conditional statement on line 02 allows a developer to correctly determine that a button on page is clicked?
- A. button.addEventListener('click')
- B. e.nodeTarget ==this
- C. event.target.nodeName == 'BUTTON'
- D. Event.clicked
Answer: C
NEW QUESTION 76
Given the JavaScript below:
Which code should replace the placeholder comment on line 05 to highlight accounts that match the search string'
- A. 'yellow : 'none'
- B. 'none1 : "yellow'
- C. null : 'yellow'
- D. 'yellow' : null
Answer: A
NEW QUESTION 77
In which situation should a developer include a try .. catch block around their function call ?
- A. The function contains scheduled code.
- B. The function has an error that should not be silenced.
- C. The function results in an out of memory issue.
- D. The function might raise a runtime error that needs to be handled.
Answer: D
NEW QUESTION 78
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. ' visible ' : ' hidden '
- B. ' name ' : ' block '
- C. ' Block ' : ' none '
- D. ' hidden ' : ' visible '
Answer: C
NEW QUESTION 79
Refer to the code below:
What is the result when the Promise in the execute function is rejected?
- A. Rejected
- B. Resolved1 Resolved2 Resolved3 Resolved4
- C. Rejected1 Rejected2 Rejected3 Rejected Rejected Rejected4
- D. Rejected Resolved
Answer: D
NEW QUESTION 80
A developer has two ways to write a function:
Option A:
function Monster() {
This.growl = () => {
Console.log ("Grr!");
}
}
Option B:
function Monster() {};
Monster.prototype.growl =() => {
console.log("Grr!");
}
After deciding on an option, the developer creates 1000 monster objects.
How many growl methods are created with Option A Option B?
- A. 1 growl method is created regardless of which option is used.
- B. 1000 growl methods are created regardless of which option is used.
- C. 1 growl method is created for Option A. 1000 growl methods are created for Option B.
- D. 1000 growl method is created for Option A. 1 growl methods are created for Option B.
Answer: D
NEW QUESTION 81
Considering type coercion, what does the following expression evaluate to?
True + '13' + NaN
- A. ' 113Nan '
- B. ' true13NaN '
- C. 0
- D. ' true13 '
Answer: B
NEW QUESTION 82
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 Scarf
This is a discounted Shirt - B. This is a Scarf
This is a Shirt
This is a discounted Scarf
This is a discounted Shirt - C. This is aScarf
Uncaught TypeError: saleItem.description is not a function
This is a Shirt
This is a did counted Shirt - D. This is a Scarf
Uncaught TypeError: saleItem.description is not a function
This is aScarf
This is a discounted Shirt
Answer: A
NEW QUESTION 83
......
Salesforce CRT-600 Exam Syllabus Topics:
| Topic | Details |
|---|---|
| Topic 1 |
|
| Topic 2 |
|
| Topic 3 |
|
| Topic 4 |
|
CRT-600 Dumps PDF - Want To Pass CRT-600 Fast: https://www.actualpdf.com/CRT-600_exam-dumps.html
