Valid CRT-600 Exam Q&A PDF CRT-600 Dump is Ready (Updated 160 Questions)
Exam Questions and Answers for CRT-600 Study Guide
NEW QUESTION 94
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 0
- C. Throws an error
- D. Returns NaN
Answer: A
NEW QUESTION 95
Refer to the code below:
let o = {
get js() {
let city1 = String("st. Louis");
let city2 = String(" New York");
return {
firstCity: city1.toLowerCase(),
secondCity: city2.toLowerCase(),
}
}
}
What value can a developer expect when referencing o.js.secondCity?
- A. ' New York '
- B. An error
- C. ' new york '
- D. Undefined
Answer: C
NEW QUESTION 96
Given the code below:
Function myFunction(){
A =5;
Var b =1;
}
myFunction();
console.log(a);
console.log(b);
What is the expected output?
- A. Line 08 thrones an error, therefore line 09 is never executed.
- B. Line 08 outputs the variable, but line 09 throws an error.
- C. Both lines 08 and 09 are executed, and the variables are outputted.
- D. Both lines 08 and 09 are executed, but values outputted are undefined.
Answer: B
NEW QUESTION 97
A developer wrote the following code:
01 let X = object.value;
02
03 try {
04 handleObjectValue(X);
05 } catch (error) {
06 handleError(error);
07 }
The developer has a getNextValue function to execute after handleObjectValue(), but does not want to execute getNextValue() if an error occurs.
How can the developer change the code to ensure this behavior?
- A. 03 try {
04 handleObjectValue(x)
05 ........................ - B. 03 try{
04 handleObjectValue(x);
05 } catch(error){
06 handleError(error);
07 }
08 getNextValue(); - C. 03 try{
04 handleObjectValue(x);
05 } catch(error){
06 handleError(error);
07 } finally {
08 getNextValue();
10 } - D. 03 try{
04 handleObjectValue(x);
05 } catch(error){
06 handleError(error);
07 } then {
08 getNextValue();
09 }
Answer: A
NEW QUESTION 98
Refer to the code snippet below:
Let array = [1, 2, 3, 4, 4, 5, 4, 4];
For (let i =0; i < array.length; i++)
if (array[i] === 4) {
array.splice(i, 1);
}
}
What is the value of array after the code executes?
- A. [1, 2, 3, 4, 5, 4, 4]
- B. [1, 2, 3, 4, 4, 5, 4]
- C. [1, 2, 3, 5]
- D. [1, 2, 3, 4, 5, 4]

Answer: B
NEW QUESTION 99
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 ( ). done(function(data){
return data;
}); - B. Async runParallel () .then(data);
- C. runParallel () .then(function(data)
return da - D. runParallel () .then(data);
Answer: A,C
NEW QUESTION 100
A developer creates a class that represents a blog post based on the requirement that a Post should have a body author and view count.
The Code shown Below:
Class Post {
// Insert code here
This.body =body
This.author = author;
this.viewCount = viewCount;
}
}
Which statement should be inserted in the placeholder on line 02 to allow for a variable to be set to a new instanceof a Post with the three attributes correctly populated?
- A. constructor() {
- B. super (body, author, viewCount) {
- C. Function Post (body, author, viewCount) {
- D. constructor (body, author, viewCount) {
Answer: D
NEW QUESTION 101
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 102
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 to 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 103
A developer has an ErrorHandler module that contains multiple functions.
What kind of export be leverages so that multiple functions can be used?
- A. All
- B. Multi
- C. Default
- D. Named
Answer: D
NEW QUESTION 104
What is the result of the code block?
- A. The console logs 'flag' and then an error is thrown.
- B. The console logs only 'flag'.
- C. An error is thrown.
- D. The console logs 'flag' and another flag.
Answer: A
NEW QUESTION 105
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:
- A. The information stored in the window.localStorage property
- B. The values of the carSpeed and fourWheels variables
- C. The style, event listeners and other attributes applied to the carSpeed DOM element
- D. A variable displaying the number of instances created for the Car Object.
Answer: A,C
NEW QUESTION 106
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 107
Refer to the code below:
Function changeValue(obj) {
Obj.value = obj.value/2;
}
Const objA = (value: 10);
Const objB = objA;
changeValue(objB);
Const result = objA.value;
What is the value of result after the code executes?
- A. 0
- B. Nan
- C. Undefined
- D. 1
Answer: D
NEW QUESTION 108
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?
- A. const https =require('https');
- B. const server =require('secure-server');
- C. const tls = require('tls');
- D. const http =require('http');
Answer: A
NEW QUESTION 109
Which code statement correctly retrieves and returns an object from localStorage?
- A. const retrieveFromLocalStorage = (storageKey) =>{
return window.localStorage[storageKey];
} - B. const retrieveFromLocalStorage = () =>{
return JSON.stringify(window.localStorage.getItem(storageKey));
} - C. const retrieveFromLocalStorage = (storageKey) =>{
return JSON.parse(window.localStorage.getItem(storageKey));
} - D. const retrieveFromLocalStorage = (storageKey) =>{
return window.localStorage.getItem(storageKey);
}
Answer: C
NEW QUESTION 110
Refer to code below:
Let first = 'who';
Let second = 'what';
Try{
Try{
Throw new error('Sad trombone');
}catch (err){
First ='Why';
}finally {
Second ='when';
} catch (err) {
Second ='Where';
}
What are the values for first and second once the code executes ?
- A. First is why and second is where
- B. First is who and second is where
- C. First is why and second is when
- D. First is Who and second is When
Answer: C
NEW QUESTION 111
Which option is true about the strict mode in imported modules?
- A. Add the statement use non-strict, before any other statements in the module to enable not-strict mode.
- B. Imported modules are in strict mode whether you declare them as such or not.
- C. Add the statement use strict =false; before any other statements in the module to enable not- strict mode.
- D. You can only reference notStrict() functions from the imported module.
Answer: D
NEW QUESTION 112
developer has a web server running with Node.js. The command to start the web server is node server,js. The web server started having latency issues. Instead of a one second turn around for web requests, the developer now sees a five second turnaround, Which command can the web developer run to see what the module is doing during the latency period?
- A. DEBUG =true node server.js
- B. DEBUG = http, https node server.js
- C. NODE_DEBUG =true node server.js
- D. NODE_DEBUG =http, https node server.js
Answer: A
NEW QUESTION 113
Teams at Universal Containers (UC) work on multiple JavaScript projects at the same time.
UC is thinking about reusability and how each team can benefit from the work of others.
Going open-source or public is not an option at this time.
Which option is available to UC with npm?
- A. Private packages are not supported, but they can use another package manager like yarn.
- B. Private registries are not supported by npm, but packages can be installed via URL.
- C. Private registries are not supported by npm, but packages can be installed via git.
- D. Private packages can be scored, and scopes can be associated to a private registries.
Answer: D
NEW QUESTION 114
A developer writers the code below to calculate the factorial of a given number.
Function factorial(number) {
Return number + factorial(number -1);
}
factorial(3);
What is the result of executing line 04?
- A. -Infinity
- B. RuntimeError
- C. 0
- D. 1
Answer: B
NEW QUESTION 115
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 116
Which function should a developer use to repeatedly execute code at a fixed interval ?
- A. setPeriod
- B. setTimeout
- C. setInteria
- D. setIntervel
Answer: D
NEW QUESTION 117
A developer receives a comment from the Tech Lead that the code given below has error:
const monthName = 'July';
const year = 2019;
if(year === 2019) {
monthName = 'June';
}
Which line edit should be made to make this code run?
- A. 03 if (year == 2019) {
- B. 01 let monthName ='July';
- C. 02 let year =2019;
- D. 02 const year = 2020;
Answer: B
NEW QUESTION 118
is below:
<input type="file" onchange="previewFile()">
<img src="" height="200" alt="Image Preview..."/>
The JavaScript portion is:
01 function previewFile(){
02 const preview = document.querySelector('img');
03 const file = document.querySelector('input[type=file]').files[0];
04 //line 4 code
05 reader.addEventListener("load", () => {
06 preview.src = reader.result;
07 },false);
08 //line 8 code
09 }
In lines 04 and 08, which code allows the user to select an image from their local computer , and to display the image in the browser?
- A. 04 const reader = new FileReader();
08 if (file) URL.createObjectURL(file); - B. 04 const reader = new File();
08 if (file) URL.createObjectURL(file); - C. 04 const reader = new FileReader();
08 if (file) reader.readAsDataURL(file); - D. 04 const reader = new File();
08 if (file) reader.readAsDataURL(file);
Answer: C
NEW QUESTION 119
......
Certification dumps - Salesforce Certified CRT-600 guides - 100% valid: https://www.vcedumps.com/CRT-600-examcollection.html
100% Pass Your CRT-600 Salesforce Certified JavaScript Developer I at First Attempt with VCEDumps: https://drive.google.com/open?id=1HvFfx5HSnyX6RwLgR6vruSXyWPbfTN5O
