0% found this document useful (0 votes)
27 views

javascript-developer-i_1

The document provides a collection of exam questions and answers for the Salesforce Certified JavaScript Developer I certification. It includes various JavaScript concepts, coding scenarios, and best practices related to the language. The document also promotes a resource for obtaining exam dumps in VCE and PDF formats from SurePassExam.

Uploaded by

asha.shaik
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

javascript-developer-i_1

The document provides a collection of exam questions and answers for the Salesforce Certified JavaScript Developer I certification. It includes various JavaScript concepts, coding scenarios, and best practices related to the language. The document also promotes a resource for obtaining exam dumps in VCE and PDF formats from SurePassExam.

Uploaded by

asha.shaik
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Recommend!!

Get the Full JavaScript-Developer-I dumps in VCE and PDF From SurePassExam
https://www.surepassexam.com/JavaScript-Developer-I-exam-dumps.html (219 New Questions)

Salesforce
Exam Questions JavaScript-Developer-I
Salesforce Certified JavaScript Developer I

Passing Certification Exams Made Easy visit - https://www.surepassexam.com


Recommend!! Get the Full JavaScript-Developer-I dumps in VCE and PDF From SurePassExam
https://www.surepassexam.com/JavaScript-Developer-I-exam-dumps.html (219 New Questions)

NEW QUESTION 1
Refer to the code below:
<html lang=”en”>
<table onclick=”console.log(Table log’);”>
<tr id=”row1”>
<td>Click me!</td>
</tr>
<table>
<script>
function printMessage(event) { console.log(‘Row log’);
}
Let elem = document.getElementById(‘row1’); elem.addEventListener(‘click’, printMessage, false);
</script>
</html>
Which code change should be made for the console to log only Rowlog when ‘Click me! ’ is clicked?

A. Add.event.stopPropagation(); to window.onLoad event handler.


B. Add event.stopPropagation(); to printMessage function.
C. Add event.removeEventListener(); to window.onLoad event handler.
D. Addevent.removeEventListener(); toprintMessage function.

Answer: B

NEW QUESTION 2
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: ABE

NEW QUESTION 3
Refer to the code:

Given the requirement to refactor the code above to JavaScript class format, which class definition is correct?
A)

B)

C)

Passing Certification Exams Made Easy visit - https://www.surepassexam.com


Recommend!! Get the Full JavaScript-Developer-I dumps in VCE and PDF From SurePassExam
https://www.surepassexam.com/JavaScript-Developer-I-exam-dumps.html (219 New Questions)

D)

A.

Answer: B

NEW QUESTION 4
Refer to the code below:
Let car1 = new Promise((_ , reject) => setTimeout(reject, 2000, “car 1 crashed in” =>
Let car2 =new Promise(resolve => setTimeout(resolve, 1500, “car 2 completed”) Let car3 =new Promise(resolve => setTimeout(resolve, 3000, “car 3 completed”)
Promise.race(( car1, car2, car3))
.t hen (value => (
Let result = ‘$(value) the race.’;)}
.catch(arr => {
console.log(“Race is cancelled.”, err);
});
What isthe value of result when Promise.race executes?

A. Car 3 completes the race


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

Answer: B

NEW QUESTION 5
Given the code below: Function myFunction(){ A =5;
Var b =1;
}
myFunction(); console.log(a); console.log(b);
What is the expected output?

A. Both lines 08 and 09 are executed, and the variables are outputted.
B. Line 08outputs the variable, but line 09 throws an error.
C. Line 08 thrones an error, therefore line 09 is never executed.
D. Both lines 08 and 09 are executed, but values outputted are undefined.

Answer: B

NEW QUESTION 6
Referto the code below: Const pi = 3.1415326, What is the data type of pi?

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

Answer: B

NEW QUESTION 7
Refer to the code below: const addBy = ?
const addByEight =addBy(8); const sum = addBYEight(50);
Which two functions can replace line 01 and return 58 to sum? Choose 2 answers

Passing Certification Exams Made Easy visit - https://www.surepassexam.com


Recommend!! Get the Full JavaScript-Developer-I dumps in VCE and PDF From SurePassExam
https://www.surepassexam.com/JavaScript-Developer-I-exam-dumps.html (219 New Questions)

A. const addBy = function(num1){ return function(num2){return num1 + num2;}


B. const addBy = function(num1){ return num1 + num2;}
C. const addBy = (num1) => num1 + num2 ;
D. const addBY = (num1) => (num2) => num1 + num2;

Answer: AD

NEW QUESTION 8
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”).Value = ’Completed’ ;
B. document.getElementById(“#status”).innerHTML = ’Completed’ ;
C. document.getElementById(“status”).innerHTML = ’Completed’ ;
D. document.getElementById(“.status”).innerHTML = ’Completed’ ;

Answer: C

NEW QUESTION 9
Which three actions can be using the JavaScript browser console? Choose 3 answers:

A. View and change DOM the page.


B. Display a report showing the performance of a page.
C. Run code that is not related to page.
D. view , change, and debug the JavaScript code of the page.
E. View and change security cookies.

Answer: ACD

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

A. const retrieveFromLocalStorage = () =>{return JSON.stringify(window.localStorage.getItem(storageKey));}

B. const retrieveFromLocalStorage = (storageKey) =>{ return window.localStorage.getItem(storageKey);}

C. const retrieveFromLocalStorage = (storageKey) =>{ returnJSON.parse(window.localStorage.getItem(storageKey));}

D. const retrieveFromLocalStorage = (storageKey) =>{ return window.localStorage[storageKey];}

Answer: C

NEW QUESTION 10
A developer wrote the following code: 01 let X = object.value;
02
3 try {
4 handleObjectValue(X); 05 } catch (error) {
6 handleError(error);
7}
The developer has a getNextValue function to execute after handleObjectValue(), but does not want to execute getNextValue() if an error occurs.
How can the developer change the code to ensure thisbehavior?

A. 03 try{4 handleObjectValue(x);5 } catch(error){6 handleError(error); 07 } then {8 getNextValue();9 }


B. 03 try{4 handleObjectValue(x);5 } catch(error){6 handleError(error); 07 } finally {08 getNextValue();10 }
C. 03 try{04handleObjectValue(x); 05 } catch(error){6 handleError(error);7 }8 getNextValue();
D. 03 try {04 handleObjectValue(x)05 ……………………

Answer: D

NEW QUESTION 12
A developer writers the code below to calculate the factorial of a given number.

What isthe result of executing line 04?

A. 6
B. -Infinity
C. RuntimeError

Passing Certification Exams Made Easy visit - https://www.surepassexam.com


Recommend!! Get the Full JavaScript-Developer-I dumps in VCE and PDF From SurePassExam
https://www.surepassexam.com/JavaScript-Developer-I-exam-dumps.html (219 New Questions)

Answer: D

Explanation:

NEW QUESTION 15
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 = textValue.toInteger();
D. Let numberValue = Integer(textValue);

Answer: A

NEW QUESTION 18
Refer to code below:

What is displayed when the code executes?

A. ReferenceError: b is not defined


B. a
C. Undefined
D. Null

Answer: C

Explanation:

NEW QUESTION 19
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, UCdecides to implement a debounce function on string change handler.

Passing Certification Exams Made Easy visit - https://www.surepassexam.com


Recommend!! Get the Full JavaScript-Developer-I dumps in VCE and PDF From SurePassExam
https://www.surepassexam.com/JavaScript-Developer-I-exam-dumps.html (219 New Questions)

What are three key steps to implement this debounce function? Choose 3 answers:

A. If there is an existing setTimeout and the search string change, allow the existingsetTimeout to finish,and do not enqueue a new setTimeout.
B. When the search string changes, enqueue the request within a setTimeout.
C. Ensure that the network request has the property debounce set to true.
D. 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.
E. Store the timeId of the setTimeout last enqueued by the search string change handle.

Answer: ABC

NEW QUESTION 24
Given HTML below:

Which statement adds the priority = account CSS class to the universal COntainers row ?

A. Document.querySelector(‘#row-uc’).classes.push(‘priority-account’);
B. Document .queryElementById(‘row-uc’).addclass(‘priority-account’);
C. Document .querySelector(‘#row-uc’).classList.add(‘priority-account’);
D. Document .querySelectorALL(‘#row-uc’).classList.add(‘priority-account’);

Answer: B

NEW QUESTION 28
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.timeLog()
B. console.getTime()
C. console.trace()
D. console.timeStamp()

Answer: A

NEW QUESTION 31
Refer to the code below: function changeValue(param) { Param =5;
}
Let a =10;
Let b =5; changeValue(b);
Const result = a+ “ - ”+ b;
What is the value of result when code executes?

A. 10 -10
B. 5 -5
C. 5 - 10
D. 10 - 5

Answer: A

NEW QUESTION 32
Considering type coercion, what does the following expression evaluate to? True + ‘13’ + NaN

A. ‘ 113Nan ’
B. 14
C. ‘ true13 ’
D. ‘ true13NaN ’

Answer: D

NEW QUESTION 33
A developer creates a class that represents a blog post based on the requirement that a Post should have a body author and view count.
The Code shown Below: ClassPost {
// Insert code here This.body =body This.author = author;
this.viewCount = viewCount;
}
}
Which statement should be inserted in the placeholder on line 02 to allow for a variable to be set to a new instanceof a Post with the three attributes correctly
populated?

Passing Certification Exams Made Easy visit - https://www.surepassexam.com


Recommend!! Get the Full JavaScript-Developer-I dumps in VCE and PDF From SurePassExam
https://www.surepassexam.com/JavaScript-Developer-I-exam-dumps.html (219 New Questions)

A. super (body, author, viewCount) {


B. Function Post (body, author, viewCount) {
C. constructor (body, author, viewCount) {
D. constructor() {

Answer: C

NEW QUESTION 35
Universal Containers (UC) just launched a new landing page, but users complain that the website is slow. A developer found some functions any that might cause
this problem. To verify this, the developer decides to execute everything and log the time each of these three suspicious functions consumes.
Which function can the developer use to obtain the time spent by every one of the three functions?

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

Answer: A

NEW QUESTION 38
Refer to code below:

What are the values for first and second once the code executes ?

A. First is Who and second is When


B. First is why and second is where
C. First is who and second is where
D. First is why andsecond is when

Answer: D

NEW QUESTION 41
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

NEW QUESTION 45
A developer wants to setup a secure web server with Node.js. The developer creates a directory locally called app-server, and the first file is app-server/index.js
Without using any third-party libraries, what should the developer add to index.js to create the secure web server?

A. const https =require(‘https’);


B. const server =require(‘secure-server’);
C. const tls = require(‘tls’);

Passing Certification Exams Made Easy visit - https://www.surepassexam.com


Recommend!! Get the Full JavaScript-Developer-I dumps in VCE and PDF From SurePassExam
https://www.surepassexam.com/JavaScript-Developer-I-exam-dumps.html (219 New Questions)

D. const http =require(‘http’);

Answer: A

NEW QUESTION 47
Which codestatement below correctly persists an objects in local Storage ?

A. const setLocalStorage = (storageKey, jsObject) => { window.localStorage.setItem(storageKey, JSON.stringify(jsObject));}


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

Answer: A

NEW QUESTION 49
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.apply ([ ], inArray);
B. [ ]. Concat (... inArray);
C. [ ]. concat.apply(inArray, [ ]);
D. [ ]. concat ( [ ….inArray ] );

Answer: AB

NEW QUESTION 50
A developer creates a generic function to log custom messages in the console. To do this, the function below is implemented.

Which three console logging methods allow the use of string substitution in line 02?

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

Answer: AD

NEW QUESTION 54
Refer to the code below: let timeFunction =() => {
console.log(‘Timer called.”);
};
let timerId = setTimeout (timedFunction, 1000);
Which statement allows a developer to cancel the scheduled timed function?

A. removeTimeout(timedFunction);
B. removeTimeout(timerId);
C. clearTimeout(timerId);
D. clearTimeout(timedFunction);

Answer: C

NEW QUESTION 57
Which statement accurately describes the behaviour of the async/ await keyworks ?

A. The associated class contains some asynchronous functions.


B. The associated function will always return apromise
C. The associated function can only be called via asynchronous methods
D. The associated sometimes returns a promise.

Answer: B

NEW QUESTION 60
GIven a value, which three options can a developer use to detect if the value is NaN? Choose 3 answers !

A. value == NaN
B. Object.is(value, NaN)
C. value === Number.NaN
D. value ! == value
E. Number.isNaN(value)

Passing Certification Exams Made Easy visit - https://www.surepassexam.com


Recommend!! Get the Full JavaScript-Developer-I dumps in VCE and PDF From SurePassExam
https://www.surepassexam.com/JavaScript-Developer-I-exam-dumps.html (219 New Questions)

Answer: AE

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

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

Answer: BC

NEW QUESTION 68
In which situation should a developer include a try .. catch block around their function call ?

A. The function has an error that shouldnot be silenced.


B. The function results in an out of memory issue.
C. The function might raise a runtime error that needs to be handled.
D. The function contains scheduled code.

Answer: C

NEW QUESTION 69
A developer is required to write a function that calculates the sum of elements in an
array but is getting undefinedevery time the code is executed. The developer needs to find what is missing in the code below.
Const sumFunction = arr => {
Return arr.reduce((result, current) => {
//
Result += current;
//
), 10);
);
Which option makes the code work as expected?

A. Replace line 02 with return arr.map(( result, current) => (


B. Replace line 04 with result = result +current;
C. Replace line 03 with if(arr.length == 0 ) ( return 0; )
D. Replace line 05 with return result;

Answer: D

NEW QUESTION 70
Given two expressions var1 and var2. What are two valid ways to return the logical AND of the two expressions and ensure it is data typeBoolean ?
Choose 2 answers:

A. Boolean(var1 && var2)


B. var1 && var2
C. var1.toBoolean() && var2toBoolean()
D. Boolean(var1) && Boolean(var2)

Answer: AD

NEW QUESTION 75
Refer to the code below:
Async funct on functionUnderTest(isOK) { If (isOK) return ‘OK’ ;
Throw new Error(‘not OK’);
)
Which assertion accuretely tests the above code?

A. Console.assert (await functionUnderTest(true), ‘ OK ’)


B. Console.assert (await functionUnderTest(true), ‘ not OK ’)
C. Console.assert (awaitfunctionUnderTest(true), ‘ not OK ’)
D. Console.assert (await functionUnderTest(true), ‘OK’)

Answer: D

NEW QUESTION 79
A developer implements a function that adds a few values.

Passing Certification Exams Made Easy visit - https://www.surepassexam.com


Recommend!! Get the Full JavaScript-Developer-I dumps in VCE and PDF From SurePassExam
https://www.surepassexam.com/JavaScript-Developer-I-exam-dumps.html (219 New Questions)

Which three options can the developer invoke for this function to get a return value of 10 ? Choose 3 answers

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

Answer: CD

NEW QUESTION 84
developer wants to use a module nameduniversalContainersLib 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 (foo, bar) from ‘/path/universalContainersLib.js’; foo();bar();
C. import all from ‘/path/universalContaineraLib.js’; universalContainersLib.foo(); universalContainersLib.bar();
D. import * from ‘/path/universalContaineraLib.js’; universalContainersLib.foo(); universalContainersLib.bar();

Answer: A

NEW QUESTION 89
Which two code snippets show working examples of a recursive function? Choose 2 answers

A. Let countingDown = function(startNumber) { If ( startNumber >0) { console.log(startNumber) ;return countingDown(startNUmber);} else {return startNumber;}};
B. Function factorial ( numVar ) { If (numVar < 0) return;If ( numVar === 0 ) return 1; return numVar -1;
C. Const sumToTen = numVar => { If (numVar < 0)Return;return sumToTen(numVar + 1)};
D. Const factorial =numVar => { If(numVar < 0) return;If ( numVar === 0 ) return 1;return numVar * factorial ( numVar - 1 );};

Answer: AD

NEW QUESTION 90
Which option is true about the strict mode in imported modules?

A. Add the statement use non-strict, before any other statements in the module to enable not-strict mode.
B. You can only reference notStrict() functions from the imported module.
C. Imported modules are in strict mode whether you declare them as such or not.
D. Add the statement use strict =false; before any other statements in the module to enable not- strict mode.

Answer: B

NEW QUESTION 94
......

Passing Certification Exams Made Easy visit - https://www.surepassexam.com


Recommend!! Get the Full JavaScript-Developer-I dumps in VCE and PDF From SurePassExam
https://www.surepassexam.com/JavaScript-Developer-I-exam-dumps.html (219 New Questions)

Thank You for Trying Our Product

We offer two products:

1st - We have Practice Tests Software with Actual Exam Questions

2nd - Questons and Answers in PDF Format

JavaScript-Developer-I Practice Exam Features:

* JavaScript-Developer-I Questions and Answers Updated Frequently

* JavaScript-Developer-I Practice Questions Verified by Expert Senior Certified Staff

* JavaScript-Developer-I Most Realistic Questions that Guarantee you a Pass on Your FirstTry

* JavaScript-Developer-I Practice Test Questions in Multiple Choice Formats and Updatesfor 1 Year

100% Actual & Verified — Instant Download, Please Click


Order The JavaScript-Developer-I Practice Test Here

Passing Certification Exams Made Easy visit - https://www.surepassexam.com


Powered by TCPDF (www.tcpdf.org)

You might also like