Latest CRT-600 Pass Guaranteed Exam Dumps with Accurate & Updated Questions [Q90-Q112]

Share

Latest CRT-600 Pass Guaranteed Exam Dumps with Accurate & Updated Questions

CRT-600 Exam Brain Dumps - Study Notes and Theory

NEW QUESTION # 90
A developer is trying to handle an error within a function.
Which code segment shows the correct approach to handle an error without propagating it elsewhere?
A)

B)

C)

D)

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

Answer: B


NEW QUESTION # 91
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. Throws an error
  • B. Returns 10
  • C. Returns 0
  • D. Returns NaN

Answer: D


NEW QUESTION # 92
A developer creates an object where its properties should be immutable and prevent properties from being added or modified.
Which method should be used to execute this business requirement ?

  • A. Object.eval()
  • B. Object.lock()
  • C. Object.const()
  • D. Object.freeze()

Answer: D


NEW QUESTION # 93
Given the code below:

What is logged to the console'

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

Answer: B


NEW QUESTION # 94
In the browser, the window object is often used to assign variables that require the broadest scope in an application Node.js application does not have access to the window object by default.
Which two methods are used to address this ?
Choose 2 answers

  • A. Create a new window object in the root file.
  • B. Assign variables to the global object.
  • C. Use the document object instead of the window object.
  • D. Assign variables to module.exports and require them as needed.

Answer: B


NEW QUESTION # 95
Refer to the code declarations below:

Which three expressions return the string JavaScript?
Choose 3 answers

  • A. Str1.join (str2);
  • B. Str1.concat (str2);
  • C. Str1 + str2;
  • D. $(str1) $ (str2} ';
  • E. Concat (str1, str2);

Answer: B,C,D


NEW QUESTION # 96
The developer has a function that prints "Hello" to an input name. To test this, thedeveloper created a function that returns "World". However the following snippet does not print " Hello World".

What can the developer do to change the code to print "Hello World" ?

  • A. Change line 5 to function world ( ) {
  • B. Change line 9 to sayHello(world) ();
  • C. Change line 7 to ) () ;
  • D. Change line 2 to console.log('Hello' , name() );

Answer: D


NEW QUESTION # 97
Refer to the code below:
Const pi = 3.1415326,
What is the data type of pi?

  • A. Number
  • B. Double
  • C. Decimal
  • D. Float

Answer: A


NEW QUESTION # 98
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 >undefined
  • B. > 5 > 0
  • C. > true > false
  • D. > 5 > -1

Answer: A

Explanation:


NEW QUESTION # 99
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(gamename) = function() {
  • B. Console16bit.prototype.load(gamename) {
  • C. Console16bit.prototype.load = function(gamename) {
  • D. Console16bit = Object.create(GameConsole.prototype).load = function
    (gamename) {

Answer: C


NEW QUESTION # 100
A developer wants to define a function log to be used a few times on a single-file JavaScript script.
01 // Line 1 replacement
02 console.log('"LOG:', logInput);
03 }
Which two options can correctly replace line 01 and declare the function for use?
Choose 2 answers

  • A. function log = (logInput) {
  • B. function leg(logInput) {
  • C. const log = (logInput) => {
  • D. const log(loginInput) {

Answer: B,C


NEW QUESTION # 101
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 # 102
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. Line 13 throws an error.
  • D. Undefined

Answer: D


NEW QUESTION # 103
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. Throws an error
  • B. Returns 10
  • C. Returns 0
  • D. Returns NaN

Answer: B


NEW QUESTION # 104
Refer to the code below:
Let inArray =[ [ 1, 2 ] , [ 3, 4, 5 ] ];
Which two statements result in the array [1, 2, 3, 4, 5] ?
Choose 2 answers

  • A. [ ]. concat ( [ ....inArray ] );
  • B. [ ]. Concat.apply ([ ], inArray);
  • C. [ ]. concat.apply(inArray, [ ]);
  • D. [ ]. Concat (... inArray);

Answer: B,D


NEW QUESTION # 105
Refer to the code below:
new Promise((resolve, reject) => {
const fraction = Math.random();
if( fraction >0.5) reject("fraction > 0.5, " + fraction);
resolve(fraction);
})
.then(() =>console.log("resolved"))
.catch((error) => console.error(error))
.finally(() => console.log(" when am I called?"));

When does Promise.finally on line 08 get called?

  • A. When resolved and settled
  • B. WHen resolved
  • C. When rejected
  • D. When resolved or rejected

Answer: D


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

Answer: D


NEW QUESTION # 108
Refer to the following array:
Let arr1 = [ 1, 2, 3, 4, 5 ];

Which two lines of code result in a second array, arr2 being created such that arr2 is not a reference to arr1?

  • A. Let arr2 = Array.from(arr1);
  • B. Let arr2 = arr1;
  • C. Let arr2 = arr1.sort();
  • D. Let arr2 = arr1.slice(0, 5);

Answer: A,D


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

Answer: B,D,E


NEW QUESTION # 110
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[0] === 0 && arr[ arr.length] === 0);
  • B. console.assert (arr.length >0);
  • C. console.assert( arr.length === 5 );
  • D. arr.forEach(elem => console.assert(elem === 0)) ;

Answer: C,D


NEW QUESTION # 111
A test has a dependency on database.query. During the test the dependency is replaced with an object called database with the method, query, that returns an array. The developer needs to verify how many times the method was called and the arguments used each time.
Which two test approaches describe the requirement?
Choose 2 answers

  • A. Integration
  • B. Black box
  • C. White box
  • D. Mocking

Answer: C,D


NEW QUESTION # 112
......

Pass Salesforce CRT-600 Test Practice Test Questions Exam Dumps: https://passleader.testpassking.com/CRT-600-exam-testking-pass.html