CRT-600 Dumps PDF - CRT-600 Real Exam Questions Answers [Q40-Q63]

Share

CRT-600 Dumps PDF - CRT-600 Real Exam Questions Answers

Get Started: CRT-600 Exam [2021] Dumps Salesforce PDF Questions


Salesforce CRT-600 Exam Syllabus Topics:

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

 

NEW QUESTION 40
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 immutable.
  • B. Non-primitive values are immutable.
  • C. Non-primitive values are mutable.
  • D. Primitive values are mutable.

Answer: A

 

NEW QUESTION 41
Which javascript methods can be used to serialize an object into a string and deserialize a JSON string into an object, respectively?

  • A. JSON.encode and JSON.decode
  • B. JSON.stringify and JSON.parse
  • C. JSON.serialize and JSON.deserialize
  • D. JSON.parse and JSON.deserialize

Answer: B

 

NEW QUESTION 42
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: A

 

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

Answer: B,D

 

NEW QUESTION 44
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. document.addEventListener(''onDOMContextLoaded', personalizeWebsiteContext);
  • C. Document.addEventListener('''DOMContextLoaded' , personalizeWebsiteContext);
  • D. window.addEventListener('onload', personalizeWebsiteContext);

Answer: A

 

NEW QUESTION 45
Refer to code below:
function Person() {
this.firstName = 'John';
}
Person.prototype ={
Job: x => 'Developer'
};
const myFather = new Person();
const result =myFather.firstName + ' ' + myFather.job();
What is the value of the result after line 10 executes?

  • A. John Developer
  • B. John undefined
  • C. Error: myFather.job is not a function
  • D. Undefined Developer

Answer: A

 

NEW QUESTION 46
Which code statement correctly retrieves and returns an object from localStorage?

  • A. const retrieveFromLocalStorage = (storageKey) =>{
    return JSON.parse(window.localStorage.getItem(storageKey));
    }
  • B. const retrieveFromLocalStorage = (storageKey) =>{
    return window.localStorage.getItem(storageKey);
    }
  • C. const retrieveFromLocalStorage = (storageKey) =>{
    return window.localStorage[storageKey];
    }
  • D. const retrieveFromLocalStorage = () =>{
    return JSON.stringify(window.localStorage.getItem(storageKey));
    }

Answer: A

 

NEW QUESTION 47
The developer wants to test the array shown:
const arr = Array(5).fill(0)
Which two tests are the most accurate for this array ?
Choose 2 answers:

  • A. console.assert (arr.length >0);
  • B. arr.forEach(elem => console.assert(elem === 0)) ;
  • C. console.assert(arr[0] === 0 && arr[ arr.length] === 0);
  • D. console.assert( arr.length === 5 );

Answer: B,D

 

NEW QUESTION 48
Refer to the code below:
Const searchTest = 'Yay! Salesforce is amazing!" ;
Let result1 = searchText.search(/sales/i);
Let result 21 = searchText.search(/sales/i);
console.log(result1);
console.log(result2);
After running this code, which result is displayed on the console?

  • A. > 5 > 0
  • B. > 5 >undefined
  • C. > 5 > -1
  • D. > true > false

Answer: B

Explanation:

 

NEW QUESTION 49
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, 5, 4, 4]
  • B. [1, 2, 3, 4, 5, 4]
  • C. [1, 2, 3, 5]
  • D. [1, 2, 3, 4, 4, 5, 4]

Answer: B

 

NEW QUESTION 50
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 File();
    08 if (file) reader.readAsDataURL(file);
  • B. 04 const reader = new FileReader();
    08 if (file) reader.readAsDataURL(file);
  • C. 04 const reader = new File();
    08 if (file) URL.createObjectURL(file);
  • D. 04 const reader = new FileReader();
    08 if (file) URL.createObjectURL(file);

Answer: B

 

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

Answer: B

 

NEW QUESTION 52
Given the code below:
const delay = sync delay => {
Return new Promise((resolve, reject) => {
setTimeout (resolve, delay);});};
const callDelay =async () =>{
const yup =await delay(1000);
console.log(1);
What is logged to the console?

  • A. 2 1 3
  • B. 1 2 3
  • C. 1 3 2
  • D. 2 3 1

Answer: D

 

NEW QUESTION 53
Universal Containers recently launched its new landing page to host a crowd-funding campaign. The page uses an external library to display some third-party ads. Once the page is fully loaded, it creates more than 50 new HTML items placed randomly inside the DOM, like the one in the code below:

All the elements includes the same ad-library-item class, They are hidden by default, and they are randomly displayed while the user navigates through the page.

  • A. Use the browser to execute a script that removes all the element containing the class ad-library-item.
  • B. Use the DOM inspector to remove all the elements containing the class ad-library-item.
  • C. Use the browser console to execute a script that prevents the load event to be fired.
  • D. Use the DOM inspector to prevent the load event to be fired.

Answer: A

 

NEW QUESTION 54
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 55
A team that works on a big project uses npm to deal with projects dependencies.
A developer added a dependency does not get downloaded when they execute npm install.
Which two reasons could be possible explanations for this?
Choose 2 answers

  • A. The developer missed the option --save when adding the dependency.
  • B. The developer added the dependency as a dev dependency, and
    NODE_ENV
    Is set to production.
  • C. The developer added the dependency as a dev dependency, and NODE_ENV is set to production.
  • D. The developer missed the option --add when adding the dependency.

Answer: A,B,C

 

NEW QUESTION 56
Refer to code below:
Function muFunction(reassign){
Let x = 1;
var y = 1;
if( reassign ) {
Let x= 2;
Var y = 2;
console.log(x);
console.log(y);}
console.log(x);
console.log(y);}
What is displayed when myFunction(true) is called?

  • A. 2 2 1 1
  • B. 2 2 2 2
  • C. 2 2 1 2
  • D. 2 2 undefined undefined

Answer: C

 

NEW QUESTION 57
Refer to the following code that performs a basic mathematical operation on a provided input:
function calculate(num) {
Return (num +10) / 3;
}
How should line 02 be written to ensure that x evaluates to 6 in the line below?
Let x = calculate (8);

  • A. Return Integer(num +10) /3;
  • B. Return (Number (num +10 ) / 3;
  • C. Return Number(num + 10) / 3;
  • D. Return Number((num +10) /3 );

Answer: B

 

NEW QUESTION 58
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() (5, 5)
  • C. Sum () (20)
  • D. sum(5)(5)
  • E. Sum (5, 5) ()

Answer: B,D

 

NEW QUESTION 59
developer wants to use a module named universalContainersLib and them call functions from it.
How should a developer import every function from the module and then call the fuctions foo and bar ?

  • A. import * ad lib from '/path/universalContainersLib.js';
    lib.foo();
    lib.bar();
  • B. import * from '/path/universalContaineraLib.js';
    universalContainersLib.foo();
    universalContainersLib.bar();
  • C. import (foo, bar) from '/path/universalContainersLib.js';
    foo();
    bar();
  • D. import all from '/path/universalContaineraLib.js';
    universalContainersLib.foo();
    universalContainersLib.bar();

Answer: A

 

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 to make this code work as expected?

  • A. Replace line 02 with button.addCallback("click", function() {
  • B. Replace line 04 with console.log(input .value);
  • C. Replace line 02 with button.addEventListener("onclick", function() {
  • D. Replace line 03 with const input = document.getElementByName('input');

Answer: B

 

NEW QUESTION 61
Given the code below:
01 function GameConsole (name) {
02 this.name = name;
03 }
04
05 GameConsole.prototype.load = function(gamename) {
06 console.log( ` $(this.name) is loading a game : $(gamename) ...`);
07 )
08 function Console 16 Bit (name) {
09 GameConsole.call(this, name) ;
10 }
11 Console16bit.prototype = Object.create ( GameConsole.prototype) ;
12 //insert code here
13 console.log( ` $(this.name) is loading a cartridge game : $(gamename) ...`);
14 }
15 const console16bit = new Console16bit(' SNEGeneziz ');
16 console16bit.load(' Super Nonic 3x Force ');
What should a developer insert at line 15 to output the following message using the method ?
> SNEGeneziz is loading a cartridge game: Super Monic 3x Force . . .

  • A. Console16bit.prototype.load = function(gamename) {
  • B. Console16bit.prototype.load(gamename) = function() {
  • C. Console16bit = Object.create(GameConsole.prototype).load = function
    (gamename) {
  • D. Console16bit.prototype.load(gamename) {

Answer: A

 

NEW QUESTION 62
Refer to the code below:
for(let number =2 ; number <= 5 ; number += 1 ) {
// insert code statement here
}
The developer needs to insert a code statement in the location shown. The code statement has these requirements:
1. Does require an import
2. Logs an error when the boolean statement evaluates to false
3. Works in both the browser and Node.js
Which meet the requirements?

  • A. console.assert(number % 2 === 0);
  • B. console.error(number % 2 === 0);
  • C. console.debug(number % 2 === 0);
  • D. assert (number % 2 === 0);

Answer: B

 

NEW QUESTION 63
......

CRT-600 Premium Exam Engine pdf Download: https://www.vcetorrent.com/CRT-600-valid-vce-torrent.html

Verified CRT-600 Bundle Real Exam Dumps PDF: https://drive.google.com/open?id=1hwezmHUB5xD8Zhxi7RchBvVh_6tj23Qq