Salesforce crt-600 practice test

Certification Preparation for Salesforce JavaScript Developer I Exam

Last exam update: Sep 29 ,2024
Page 1 out of 10. Viewing questions 1-15 out of 157

Question 1

Which two console logs output NaN?
Choose 2 answers | |

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

B, D

User Votes:
A
50%
B 1 votes
50%
C
50%
D 1 votes
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 2

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

  • A. import * from '/path/universalContainersLib.js'; universalContainersLib. foo ()7 universalContainersLib.bar ();
  • B. import {foo,bar} from '/path/universalCcontainersLib.js'; foo(): bar()?
  • C. import all from '/path/universalContainersLib.js'; universalContainersLib.foo(); universalContainersLib.bar ();
  • D. import * as lib from '/path/universalContainersLib.js'; lib.foo(); lib. bar ();
Answer:

D

User Votes:
A
50%
B
50%
C
50%
D 1 votes
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 3

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 leg(logInput) {
  • B. const log(loginInput) {
  • C. const log = (logInput) => {
  • D. function log = (logInput) {
Answer:

A, C

User Votes:
A
50%
B
50%
C
50%
D 1 votes
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 4

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:

B

User Votes:
A 1 votes
50%
B
50%
C 1 votes
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 5

A developer implements and calls the following code when an application state change occurs:
Const onStateChange =innerPageState) => {
window.history.pushState(newPageState, , null);
}
If the back button is clicked after this method is executed, what can a developer expect?

  • A. A navigate event is fired with a state property that details the previous application state.
  • B. The page is navigated away from and the previous page in the browser’s history is loaded.
  • C. The page reloads and all Javascript is reinitialized.
  • D. A popstate event is fired with a state property that details the application’s last state.
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 6

Refer to code below:
console.log(0);
setTimeout(() => (
console.log(1);
});
console.log(2);
setTimeout(() => {
console.log(3);
), 0);
console.log(4);
In which sequence will the numbers be logged?

  • A. 01234
  • B. 02431
  • C. 02413
  • D. 13024
Answer:

C

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 7

Refer to code below:
Const objBook = {
Title: Javascript,
};
Object.preventExtensions(objBook);
Const newObjBook = objBook;
newObjectBook.author = Robert;
What are the values of objBook and newObjBook respectively ?

  • A. [title: “javaScript”] [title: “javaScript”]
  • B. {author: Robert, title: javaScript} Undefined
  • C. {author: “Robert”, title: “javaScript} {author: “Robert”, title: “javaScript}
  • D. {author: “Robert”} {author: “Robert”, title: “javaScript}
Answer:

A

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 8

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

B, C, D

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 9

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. Use the document object instead of the window object.
  • B. Assign variables to the global object.
  • C. Create a new window object in the root file.
  • D. Assign variables to module.exports and require them as needed.
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 10

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 0
  • B. Throws an error
  • C. Returns 10
  • D. Returns NaN
Answer:

C

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 11

Which three browser specific APIs are available for developers to persist data between page loads ?
Choose 3 answers

  • A. IIFEs
  • B. indexedDB
  • C. Global variables
  • D. Cookies
  • E. localStorage.
Answer:

A, B, E

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 12

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

B

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 13

Given the code below:
Setcurrent URL ();
console.log(The current URL is: +url );
function setCurrentUrl() {
Url = window.location.href:
What happens when the code executes?

  • A. The url variable has local scope and line 02 throws an error.
  • B. The url variable has global scope and line 02 executes correctly.
  • C. The url variable has global scope and line 02 throws an error.
  • D. The url variable has local scope and line 02 executes correctly.
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 14

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. Undefined
  • C. ‘ New York ’
  • D. An error
Answer:

B

User Votes:
A
50%
C
50%
D
50%
Discussions
vote your answer:
A
C
D
0 / 1000

Question 15

Why would a developer specify a package.jason as a developed forge instead of a dependency ?

  • A. It is required by the application in production.
  • B. It is only needed for local development and testing.
  • C. Other required packages depend on it for development.
  • D. It should be bundled when the package is published.
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000
To page 2