100% Pass Top-selling JavaScript-Developer-I Exams - New 2023 Salesforce Pratice Exam
Salesforce Developer Dumps JavaScript-Developer-I Exam for Full Questions - Exam Study Guide
NEW QUESTION 88
Given the following code, what is the value of x?
let x = '15' + (10 * 2);
- A. 0
- B. 1
- C. 2
- D. 3
Answer: C
NEW QUESTION 89
Given the code below:
What is the expected output?
- A. Line 08 outputs the variable, but line 09 throws an error.
- B. Line 08 throws an error, therefore line 09 is never executed.
- C. Both lines 06 and 09 are executed, but the values outputted are undefined.
- D. Both lines 08 and 09 are executed, and the variables are outputted.
Answer: A
NEW QUESTION 90
Which option is a core Node,js module?
- A. Path
- B. locate
- C. Ios
- D. Memory
Answer: A
NEW QUESTION 91
A developer tries to retrieve all cookies, then sets a certain key value pair in the cookie. These statements are used:
What is the behavior?
- A. Cookies are read and the key value is set, and all cookies are wiped.
- B. A Cookies are read and the key value is set, the remaining cookies are unaffected.
- C. Cookies are read, but the key value is not set because the value is not URL encoded.
- D. Cookies are not read because line 01 should be document, cookies, but the key value is set and all cookies are wiped.
Answer: B
NEW QUESTION 92
A developer needs to test this functions:
Which two assert statements are valid tests for this function?
- A. Console.assert(sum3 ([-3, 2]) -1) ;
- B. Console.assert(sum3([0]) 0) ;
- C. Console.assert(sum3 (['hello' 2, 3, 4]) NaN);
- D. Console.assert(sum3((1, '2' ]) 12 );
Answer: A,D
NEW QUESTION 93
Which code statement below correctly persists an objects in local Storage ?
- A. const setLocalStorage = (storageKey, jsObject) => {
window.localStorage.persist(storageKey, jsObject);
} - B. const setLocalStorage = ( jsObject) => {
window.localStorage.setItem(jsObject);
} - C. const setLocalStorage = ( jsObject) => {
window.localStorage.connectObject(jsObject));
} - D. const setLocalStorage = (storageKey, jsObject) => {
window.localStorage.setItem(storageKey, JSON.stringify(jsObject));
}
Answer: D
NEW QUESTION 94
Refer to the code:
Given the code above, which three properties are set pet1?
Choose 3 answers:
- A. Name
- B. Type
- C. canTalk
- D. Owner
- E. Size
Answer: B,C,E
NEW QUESTION 95
A developer is setting up a new Node.js server with a client library that is built using events and callbacks.
The library:
● Will establish a web socket connection and handle receipt of messages to the server
● Will be imported with require, and made available with a variable called we.
The developer also wants to add error logging if a connection fails.
Given this info, which code segment shows the correct way to set up a client with two events that listen at execution time?
- A. ws.connect (( ) => {
console.log('connected to client'); }).catch((error) => { console.log('ERROR' , error); }}; - B. try{
ws.connect (( ) => {
console.log('connected to client'); }); - C. ws.on ('connect', ( ) => { console.log('connected to client'); }}; ws.on('error', (error) => { console.log('ERROR' , error); }};
- D. ws.on ('connect', ( ) => {
console.log('connected to client'); ws.on('error', (error) => { console.log('ERROR' , error); });
});
Answer: C
Explanation:
} catch(error) { console.log('ERROR' , error); };
}
NEW QUESTION 96
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) =>{
return JSON.parse(window.localStorage.getItem(storageKey));
} - D. const retrieveFromLocalStorage = (storageKey) =>{
return window.localStorage[storageKey];
}
Answer: C
NEW QUESTION 97
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 98
Which three browser specific APIs are available for developer to persist data between page loads?
Choose 3 answers
- A. indexedDB
- B. global variables
- C. IIFEs
- D. localStorage
- E. cookies
Answer: A,C,D
NEW QUESTION 99
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 > -1
- B. > 5 > 0
- C. > 5 >undefined
- D. > true > false
Answer: C
Explanation:
NEW QUESTION 100
Given the code below:
Which method can be provide a visual representation of the list if users and to allow sorting by the name or email attributes.
- A. Console,table (userslist);
- B. Console.group (userList);
- C. Console.groupCollapsed (userslist);
- D. Console.info (userlist);
Answer: B
NEW QUESTION 101
developer removes the HTML class attribute from the checkout button, so now it is
simply:
<button>Checkout</button>.
There is a test to verify the existence of the checkout button, however it looks for a button with
class= "blue". The test fails because no such button is found.
Which type of test category describes this test?
- A. False positive
- B. False negative
- C. True negative
- D. True positive
Answer: B
NEW QUESTION 102
There is a new requirement for a developer to implement a currPrice method that will return the current price of the item or sales..
What is the output when executing the code above
- A. 50
80
Uncaught Reference Error:this,discount is undefined
72 - B. 50
80
72 - C. 50
Uncaught TypeError: saleItem,desrcription is not a function
50
80 - D. 50
80
50
72
Answer: D
NEW QUESTION 103
Refer to the following code that imports a module named Utills,
Which two implementations of Utill, je export foo and bar such that the code above runs without error?
Choose 2 answers
- A. Export default class (
Foo ( ) ( return 'foo ,; )
Bar ( ) ( return ;bar ; ) - B. //FooUtill.js and barUtils, js exist
Import (foo) from ,/Path/footUtils.js,:
Export (foo, bar) - C. Const foo = () => ( return 'foo ' ; )
Const bar => ( return 'bar' ; )
Export (foo, bar) - D. Const foo = ( ) => ( return 'foo; ; )
Const bar => => { return 'bar ';}
Export default foo, bar;
Answer: A
NEW QUESTION 104
Refer to the code below:
01 const exec = (item, delay) =>{
02 new Promise(resolve => setTimeout( () => resolve(item), delay)),
03 async function runParallel() {
04 Const (result1, result2, result3) = await Promise.all{
05 [exec ('x', '100') , exec('y', 500), exec('z', '100')]
06 );
07 return `parallel is done: $(result1) $(result2)$(result3)`;
08 }
}
}
Which two statements correctly execute the runParallel () function?
Choose 2 answers
- A. runParallel () .then(data);
- B. runParallel () .then(function(data)
return data - C. runParallel ( ). done(function(data){
return data;
}); - D. Async runParallel () .then(data);
Answer: B,C
NEW QUESTION 105
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 Number((num +10) /3 );
- B. Return (Number (num +10 ) / 3;
- C. Return Number(num + 10) / 3;
- D. Return Integer(num +10) /3;
Answer: B
NEW QUESTION 106
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 array after the code executes?
- A. [1, 2, 3, 4, 5, 4]
- B. [1, 2, 3, 4, 4, 5, 4]
- C. [1, 2, 3, 4, 5, 4, 4]
- D. [1, 2, 3, 5]
Answer: B
Explanation:
NEW QUESTION 107
A developer wants to use a module named universalContainerLib 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/universalContainerLib.js''
universalContainersLib.foo( ) ;
universalContainersLib bar ( ) : - B. import all from '/path/universalContainerLib.js''
universalContainersLib.foo( ) ;
universalContainersLib bar ( ) : - C. import (foo,bar) from '/path/universalContainerLib.js''
foo ( ) ;
bar ( ) ; - D. import - as lib from '/path/universalContainerLib.js''
lib.foo( ) ;
lib. bar ( ) ;
Answer: D
NEW QUESTION 108
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 --add 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 --save when adding the dependency.
Answer: B,C,D
NEW QUESTION 109
A developer wants to use a module called DataPrettyPrint. This module exports one default function called printDate ().
How can a developer import and use the printDate() function?
A)
B)
C)
D)
- A. Option A
- B. Option B
- C. Option C
- D. Option D
Answer: B
NEW QUESTION 110
......
Authentic Best resources for JavaScript-Developer-I Online Practice Exam: https://www.itexamsimulator.com/JavaScript-Developer-I-brain-dumps.html
JavaScript-Developer-I Test Engine Practice Exam: https://drive.google.com/open?id=1u1LPdyer8vUj2WSv2kYZ4h7BBNEkxtBH

