Online Questions - Valid Practice To your CRT-600 Exam (Updated 160 Questions) [Q44-Q62]

Share

Online Questions - Valid Practice To your CRT-600 Exam (Updated 160 Questions)

Practice To CRT-600 - Remarkable Practice On your Salesforce Certified JavaScript Developer I Exam


Salesforce CRT-600 Exam Syllabus Topics:

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

 

NEW QUESTION 44
Refer to the code below:
01 let car1 = new promise((_, reject) =>
02 setTimeout(reject, 2000, "Car 1 crashed in"));
03 let car2 = new Promise(resolve => setTimeout(resolve, 1500, "Car 2
completed"));
04 let car3 = new Promise(resolve => setTimeout (resolve, 3000, "Car 3
Completed"));
05 Promise.race([car1, car2, car3])
06 .then(value => (
07 let result = $(value) the race. `;
08 ))
09 .catch( arr => (
10 console.log("Race is cancelled.", err);
11 ));
What is the value of result when Promise.race executes?

  • A. Race is cancelled.
  • B. Car 1 crashed in the race.
  • C. Car 3 completed the race.
  • D. Car 2 completed the race.

Answer: D

 

NEW QUESTION 45
Refer to the code below:
Let textValue = '1984';
Which code assignment shows a correct way to convert this string to an integer?

  • A. Let numberValue = (Number)textValue;
  • B. let numberValue = Number(textValue);
  • C. Let numberValue = Integer(textValue);
  • D. Let numberValue = textValue.toInteger();

Answer: B

 

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

Answer: D

 

NEW QUESTION 47
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 who and second is where
  • B. First is why and second is where
  • C. First is why and second is when
  • D. First is Who and second is When

Answer: C

 

NEW QUESTION 48
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. 1000 growl method is created for Option A. 1 growl methods are created for Option B.
  • B. 1000 growl methods are created regardless of which option is used.
  • C. 1 growl method is created regardless of which option is used.
  • D. 1 growl method is created for Option A. 1000 growl methods are created for Option B.

Answer: A

 

NEW QUESTION 49
What are two unique features of functions defined with a fat arrow as compared to normal function definition?
Choose 2 answers

  • A. The function uses the this from the enclosing scope.
  • B. If the function has a single expression in the function body, the expression will be evaluated and implicit returned.
  • C. The function generated its own this making it useful for separating the function's scope from its enclosing scope.
  • D. The function receives an argument that is always in scope, called parentThis, which is the enclosing lexical scope.

Answer: B,C

 

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

Answer: C

 

NEW QUESTION 51
A developer wants to create an object from a function in the browser using the code below:
Function Monster() { this.name = 'hello' };
Const z = Monster();
What happens due to lack of the new keyword on line 02?

  • A. Window.m is assigned the correct object.
  • B. The z variable is assigned the correct object.
  • C. The z variable is assigned the correct object but this.name remains undefined.
  • D. Window.name is assigned to 'hello' and the variable z remains undefined.

Answer: D

 

NEW QUESTION 52
Which code statement below correctly persists an objects in local Storage ?

  • A. const setLocalStorage = (storageKey, jsObject) => {
    window.localStorage.persist(storageKey, jsObject);
    }
  • B. const setLocalStorage = (storageKey, jsObject) => {
    window.localStorage.setItem(storageKey, JSON.stringify(jsObject));
    }
  • C. const setLocalStorage = ( jsObject) => {
    window.localStorage.setItem(jsObject);
    }
  • D. const setLocalStorage = ( jsObject) => {
    window.localStorage.connectObject(jsObject));
    }

Answer: B

Explanation:

 

NEW QUESTION 53
Refer to the code below:

Line 05 causes an error.
What are the values of greeting and salutation once code completes?

  • A. Greeting is Goodbye and salutation is I say Hello.
  • B. Greeting is Hello and salutation is Hello, Hello.
  • C. Greeting is Goodbye and salutation is Hello, Hello.
  • D. Greeting is Hello and salutation is I say hello.

Answer: B

 

NEW QUESTION 54
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. Info
  • C. Log
  • D. Error
  • E. Message

Answer: A,B

 

NEW QUESTION 55
Refer to following code block:
Let array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,];
Let output =0;
For (let num of array){
if (output >0){
Break;
}
if(num % 2 == 0){
Continue;
}
Output +=num;
What is the value of output after the code executes?

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

Answer: D

 

NEW QUESTION 56
Which function should a developer use to repeatedly execute code at a fixed interval ?

  • A. setIntervel
  • B. setPeriod
  • C. setInteria
  • D. setTimeout

Answer: A

 

NEW QUESTION 57
Universal Containers (UC) notices that its application that allows users to search for accounts makes a network request each time a key is pressed. This results in too many requests for the server to handle.
* Address this problem, UC decides to implement a debounce function on string change handler.
What are three key steps to implement this debounce function?
Choose 3 answers:

  • A. When the search string changes, enqueue the request within a setTimeout.
  • B. If there is an existing setTimeout and the search string changes, cancel the existing setTimeout using the persisted timerId and replace it with a new setTimeout.
  • C. Store the timeId of the setTimeout last enqueued by the search string change handle.
  • D. If there is an existing setTimeout and the search string change, allow the existing setTimeout to finish, and do not enqueue a new setTimeout.
  • E. Ensure that the network request has the property debounce set to true.

Answer: A,D,E

 

NEW QUESTION 58
Refer to the HTML below:
<div id="main">
<ul>
<li>Leo</li>
<li>Tony</li>
<li>Tiger</li>
</ul>
</div>
Which JavaScript statement results in changing " Tony" to "Mr. T."?

  • A. document.querySelector('$main li.Tony').innerHTML = ' Mr. T. ';
  • B. document.querySelector('$main li:second-child').innerHTML = ' Mr. T. ';
  • C. document.querySelector('$main li:nth-child(2)'),innerHTML = ' Mr. T. ';
  • D. document.querySelectorAll('$main $TONY').innerHTML = ' Mr. T. ';

Answer: C

 

NEW QUESTION 59
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.splice(2,3);
  • B. Let x= arr.slice(2);
  • C. Let x = arr.slice(2,3);
  • D. Let x= arr.filter (( a) => (a<2));
  • E. Let x= arr.filter((a) => ( return a>2 ));

Answer: A,B,E

 

NEW QUESTION 60
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: C

 

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

Answer: A,B

 

NEW QUESTION 62
......

True CRT-600 Exam Extraordinary Practice For the Exam: https://www.testpassking.com/CRT-600-exam-testking-pass.html

Get 100% Passing Success With True CRT-600 Exam: https://drive.google.com/open?id=1_bdGk0QpA1g-NSxXN8RfoAVvsTZ8KEG7