[Feb 26, 2023] Latest CRT-600 PDF Dumps & Real Tests Free Updated Today [Q53-Q76]

Share

[Feb 26, 2023] Latest CRT-600 PDF Dumps & Real Tests Free Updated Today

CRT-600 Dumps With 100% Verified Q&As - Pass Guarantee or Full Refund

NEW QUESTION 53
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.error ((server) => {
    console.log('ERROR', error);
    });
  • B. Try{
    server.start();
    } catch(error) {
    console.log('ERROR', error);
    }
  • C. Server.on ('error', (error) => {
    console.log('ERROR', error);
    });
  • D. Server.catch ((server) => {
    console.log('ERROR', error);
    });

Answer: C

 

NEW QUESTION 54
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(1, '2')) == 12);
  • B. console.assert(sum3(0)) == 0);
  • C. console.assert(sum3(-3, 2 )) == -1);
  • D. console.assert(sum3('hello', 2, 3, 4)) === NaN);

Answer: A,C

 

NEW QUESTION 55
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
  • C. 'Undefined values!'
  • D. Line 13 throws an error.

Answer: B

 

NEW QUESTION 56
A developer creates a generic function to log custom messages in the console. To do this, the function below is implemented.
01 function logStatus(status){
02 console./*Answer goes here*/{'Item status is: %s', status};
03 }
Which three console logging methods allow the use of string substitution in line 02?

  • A. Assert
  • B. Log
  • C. Info
  • D. Message
  • E. Error

Answer: B,C,E

 

NEW QUESTION 57
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. ws.connect (( ) => {
    console.log('connected to client'); }).catch((error) => { console.log('ERROR' , error); }};
  • B. try{
    ws.connect (( ) => {
    console.log('connected to client'); });
    } catch(error) { console.log('ERROR' , error); };
    }
  • C. ws.on ('connect', ( ) => {
    console.log('connected to client'); ws.on('error', (error) => { console.log('ERROR' , error); });
    });
  • D. ws.on ('connect', ( ) => { console.log('connected to client'); }}; ws.on('error', (error) => { console.log('ERROR' , error); }};

Answer: D

 

NEW QUESTION 58
Given the following code:

is the output of line 02?

  • A. ''null'''
  • B. ''x''
  • C. ''undefined''
  • D. ''object''

Answer: D

 

NEW QUESTION 59
Which code change should be done for the console to log the following when 'Click me!' is clicked'
> Row log
> Table log

  • A. Change line 14 to elem.addEventListener ('click', printMessage, true);
  • B. Remove line 10
  • C. Change line 10 to event.stopPropagation (false) ;
  • D. Remove lines 13 and 14

Answer: C

 

NEW QUESTION 60
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(5);
    console.assert ( res === ' ' );
  • B. let res = fizzbuzz(Infinity);
    console.assert ( res === ' ' )
  • C. let res = fizzbuzz(15);
    console.assert ( res === ' fizzbuzz ' )
  • D. let res = fizzbuzz(3);
    console.assert ( res === ' buzz ' )

Answer: B,C,D

 

NEW QUESTION 61
Refer to the code below:
const event = new CustomEvent(
//Missing Code
);
obj.dispatchEvent(event);
A developer needs to dispatch a custom event called update to send information about recordId.
Which two options could a developer insert at the placeholder in line 02 to achieve this?
Choose 2 answers

  • A. 'Update' , {
    Details : {
    recordId : '123abc'
    }
    }
  • B. 'Update' , '123abc'
  • C. { type : 'update', recordId : '123abc' }
  • D. 'Update' , (
    recordId : '123abc'
    (

Answer: A,D

 

NEW QUESTION 62
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. 02 const year = 2020;
  • B. 01 let monthName ='July';
  • C. 02 let year =2019;
  • D. 03 if (year == 2019) {

Answer: B

 

NEW QUESTION 63
Universal Container(UC) just launched a new landing page, but users complain that the website is slow. A developer found some functions that cause this problem. To verify this, the developer decides to do everything and log the time each of these three suspicious functions consumes.
console.time('Performance');
maybeAHeavyFunction();
thisCouldTakeTooLong();
orMaybeThisOne();
console.endTime('Performance');
Which function can the developer use to obtain the time spent by every one of the three functions?

  • A. console.timeStamp()
  • B. console.trace()
  • C. console.timeLog()
  • D. console.getTime()

Answer: C

 

NEW QUESTION 64
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
  • C. Inner message
  • D. Outer message
    Inner message

Answer: C

 

NEW QUESTION 65
Which two console logs outputs NaN ?
Choose 2 answers

  • A. console.log(10/ Number('5'));
  • B. console.log(10/0);
  • C. console.log(parseInt('two'));
  • D. console.log(10/ ''five);

Answer: C,D

 

NEW QUESTION 66
A developer wants to use a module called DataPrettyPrint. This module exports one default function called printDate ().
How can a developer import and use the printDate() function?
A)

B)

C)

D)

  • A. Option D
  • B. Option A
  • C. Option B
  • D. Option C

Answer: C

 

NEW QUESTION 67
Refer to the string below:
const str = 'Salesforce';
Which two statements result in the word 'Sales'?
Choose 2 answers

  • A. str.substring (1, 5);
  • B. str.substr(1, 5);
  • C. str.substring (0, 5);
  • D. str.substr (0, 5);

Answer: C,D

 

NEW QUESTION 68
Refer the following code

what is the value of array after code executes?

  • A. [ 1, 2, 3, 5 ]

Answer: A

 

NEW QUESTION 69
A developer tries to retrieve all cookies, then sets a certain key value pair in the cookie. These statements are used:

What is the behavior?

  • A. Cookies are not read because line 01 should be document, cookies, but the key value is set and all cookies are wiped.
  • B. A Cookies are read and the key value is set, the remaining cookies are unaffected.
  • C. Cookies are read and the key value is set, and all cookies are wiped.
  • D. Cookies are read, but the key value is not set because the value is not URL encoded.

Answer: B

 

NEW QUESTION 70
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 the array after the code executes?

  • A. [1, 2, 3, 4, 4, 5, 4]
  • B. [1, 2, 3, 4, 5, 4, 4]
  • C. [1, 2, 3, 4, 5, 4]
  • D. [1, 2, 3, 5]

Answer: C

 

NEW QUESTION 71
A developer implements a function that adds a few values.
Function sum(num) {
If (num == undefined) {
Num =0;
}
Return function( num2, num3){
If (num3 === undefined) {
Num3 =0 ;
}
Return num + num2 + num3;
}
}
Which three options can the developer invoke for this function to get a return value of 10 ?
Choose 3 answers

  • A. sum(10) ()
  • B. Sum () (20)
  • C. sum(5)(5)
  • D. Sum (5, 5) ()
  • E. sum() (5, 5)

Answer: C,E

 

NEW QUESTION 72
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. A variable displaying the number of instances created for the Car Object.
  • B. The style, event listeners and other attributes applied to the carSpeed DOM element
  • C. The information stored in the window.localStorage property
  • D. The values of the carSpeed and fourWheels variables

Answer: B,C

 

NEW QUESTION 73
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 has an error that should not be silenced.
  • C. The function contains scheduled code.
  • D. The function results in an out of memory issue.

Answer: A

 

NEW QUESTION 74
Refer to the code below:
Let foodMenu1 = ['pizza', 'burger', 'French fries'];
Let finalMenu = foodMenu1;
finalMenu.push('Garlic bread');
What is the value of foodMenu1 after the code executes?

  • A. [ 'pizza','Burger', 'French fires', 'Garlic bread']
  • B. [ 'pizza','Burger', 'French fires']
  • C. [ 'Garlic bread']
  • D. [ 'Garlic bread' , 'pizza','Burger', 'French fires' ]

Answer: B

 

NEW QUESTION 75
Refer to the following code:
class Vehicle{
constructor(plate){
this.plate = plate;
}
}
class Truck extends Vehicle{
constructor(plate, weight){
//Missing code
this.weight = weight;
}
displayWeight(){
console.log(`The truck ${this.plate} has a weight of ${this.weight}lb.`);
}
}let myTruck = new Truck('123Ab',5000);
myTruck.displayWeight();
Which statement should be added to missing code for the code to display 'The truck 123AB has a weight of 5000lb.

  • A. Vehicle.plate = plate
  • B. this.plate = plate
  • C. super.plate = plate
  • D. super(plate)

Answer: D

 

NEW QUESTION 76
......


Salesforce CRT-600 Exam Syllabus Topics:

TopicDetails
Topic 1
  • Debugging and Error Handling
  • Throwing and Catching Errors
  • Working with the Console
Topic 2
  • Type Conversion (explicit and implicit)
  • Working with JSON
  • Data Types and Variables
Topic 3
  • Asynchronous Programming
  • Callback Functions
  • Promises and Async
  • Await
Topic 4
  • JavaScript Basics
  • Working with Strings, Numbers, and Dates
Topic 5
  • Browser and Events
  • Document Object Model
  • Browser Dev Tools
Topic 6
  • Objects, Functions, and Classes
  • Using JavaScript Modules
  • Declaring Classes

 

2023 Valid CRT-600 test answers & Salesforce Exam PDF: https://actualtests.passsureexam.com/CRT-600-pass4sure-exam-dumps.html