(2024) JavaScript-Developer-I Dumps and Practice Test (224 Questions)
Guide (New 2024) Actual Salesforce JavaScript-Developer-I Exam Questions
Salesforce is a cloud-based software that provides customer relationship management (CRM) and other business solutions. As a widely adopted CRM platform, Salesforce offers various certifications that enable professionals to demonstrate their skills in different areas of Salesforce. Among these certifications is the Salesforce Certified JavaScript Developer I, which focuses on JavaScript and its integration with Salesforce.
NEW QUESTION # 103
Given the following code:
Let x =('15' + 10)*2;
What is the value of a?
- A. 0
- B. 1
- C. 2
- D. 3
Answer: D
NEW QUESTION # 104
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 = arr1;
- B. Let arr2 = Array.from(arr1);
- C. Let arr2 = arr1.sort();
- D. Let arr2 = arr1.slice(0, 5);
Answer: B,D
NEW QUESTION # 105
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.timeStamp()
- B. console.trace()
- C. console.timeLog()
- D. console.getTime()
Answer: C
NEW QUESTION # 106
Refer to the code below:
Considering the implementations of 'use strict' on line 04, which three statements describes the executes of the code? Choose 3 answers
- A. 'use strict' has an effect only on line 05.
- B. Z is equal to 3,14.
- C. Line 05 throws an error.
- D. 'use strict' has an effect between line 04 and the end of the file.
- E. 'use strict , is hoisted, so it has an effect on all lines.
Answer: B,C,E
NEW QUESTION # 107
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 theserver 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.on ('connect', ( ) => {console.log('connected to client'); ws.on('error', (error) => { console.log('ERROR' ,error); });});
- B. ws.on ('connect', ( ) => { console.log('connected to client'); }}; ws.on('error', (error) => { console.log('ERROR' , error); }};
- C. ws.connect (( ) => {console.log('connected to client'); }).catch((error) => { console.log('ERROR' , error); }};
- D. try{ws.connect (( ) => {console.log('connected to client'); });} catch(error) { console.log('ERROR',error); };}
Answer: A
NEW QUESTION # 108
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 > 0
- B. > 5 > -1
- C. > 5 >undefined
- D. > true > false
Answer: C
NEW QUESTION # 109
Which three actions can be using the JavaScript browser console?
Choose 3 answers:
- A. View and change security cookies.
- B. view , change, and debug the JavaScript code of the page.
- C. Run code that is not related to page.
- D. View and change DOM the page.
- E. Display a report showing the performance of a page.
Answer: B,C,D
NEW QUESTION # 110
Considering type coercion, What does the following expression evaluate to?
True + '13 ' + NaN
- A. 113NaN
- B. 'true13'
- C. 0
- D. 'true13NaN'
Answer: A
NEW QUESTION # 111
A developer wrote the following code to test a sum3 function that takes in an array of numbers and returns the sum of the first three numbers in the array, and the test passes.
A different developer made changes to the behavior of sum3 to instead sum only the first two numbers present in the array.
Which two results occur when running this test on the updated sum3 function?
Choose 2 answers
- A. The line 05 assertion fails.
- B. The line 02 assertion fails.
- C. The line 02 assertion passes.
- D. The line 05 assertion passes.
Answer: A,C
NEW QUESTION # 112
Refer to the code below:
let productSKU = '8675309,;
A developer has a requirement to generate SKU numbers that are always 10 characters log, starting with 'sku', and padded with zeros.
Which statement assigned the value skuooooooooo86675309?
- A. productSKU = productSKU. Padstart (19, '0' padstart ('sku') ;
- B. productSKU = productSKU. PadEnd (16, '0' padstart (19, 'sku') ;
- C. productSKU = productSKU. PadEnd (16, '0' padstart ('sku') ;
- D. productSKU = productSKU. Padstart (16, '0' padstart (19, 'sku') ;
Answer: D
NEW QUESTION # 113
A class was written to represent items for purchase in an online store, and a secondclass Representing items that are on sale at a discounted price. THe constructor sets the name to the first value passed in. The pseudocode is below:
Class Item {
constructor(name, price) {
... // Constructor Implementation
}
}
Class SaleItem extends Item {
constructor (name, price, discount) {
...//Constructor Implementation
}
}
There is a newrequirement for a developer to implement a description method that will return a brief description for Item and SaleItem.
Let regItem =new Item('Scarf', 55);
Let saleItem = new SaleItem('Shirt' 80, -1);
Item.prototype.description = function () { return 'This is a ' + this.name; console.log(regItem.description()); console.log(saleItem.description()); SaleItem.prototype.description = function () { return 'This is a discounted ' + this.name; } console.log(regItem.description()); console.log(saleItem.description()); What is the output when executing the code above ?
- A. This is aScarfUncaught TypeError: saleItem.description is not a functionThis is a ShirtThis is a did counted Shirt
- B. This is a ScarfThis is a ShirtThis is a discounted ScarfThis is a discounted Shirt
- C. This is a ScarfUncaught TypeError: saleItem.description is not a functionThis is aScarfThis is a discounted Shirt
- D. This is a ScarfThis is a ShirtThis is a ScarfThis is a discounted Shirt
Answer: D
NEW QUESTION # 114
A test has a dependency on database. query. During the test, the dependency is replaced with an object called database with the method, Calculator query, that returns an array. The developer does not need to verify how many times the method has been called.
Which two test approaches describe the requirement?
Choose 2 answers
- A. White box
- B. Stubbing
- C. Substitution
- D. Black box
Answer: A,C
NEW QUESTION # 115
A developer wants to leverage a module to print a price in pretty format, and has imported a method as shown below:
Import printPrice from '/path/PricePrettyPrint.js';
Based on the code, what must be true about the printPrice function of the PricePrettyPrint module for this import to work ?
- A. printPrice must be a multi exportc
- B. printPrice must be an all export
- C. printPrice must be be a named export
- D. printPrice must be the default export
Answer: D
NEW QUESTION # 116
Refer to the following code block:
class Animal{
constructor(name){
this.name = name;
}
makeSound(){
console.log(`${this.name} is making a sound.`)
}
}
class Dog extends Animal{
constructor(name){
super(name)
this.name = name;
}
makeSound(){
console.log(`${this.name} is barking.`)
}
}
let myDog = new Dog('Puppy');
myDog.makeSound();
What is the console output?
- A. Puppy is barking
Answer: A
NEW QUESTION # 117
Given the expressions var1 and var2, what are two valid ways to return the concatenation of the two expressions and ensure it is string? Choose 2 answers
- A. var1 + var2
- B. string.concat (var1 +var2)
- C. String (var1) .concat (var2)
- D. var1.toString ( ) var2.toString ( )
Answer: B,D
NEW QUESTION # 118
Refer to the code below:
01 const server = require('server');
02 /* Insert code here */
A developer imports a library that creates a web server. Theimported library uses events and callbacks to start the servers Whichcode should be inserted at the line 03 to set up an event and start the web server ?
- A. Server.start ();
- B. server.on(' connect ' , ( port) => {console.log('Listening on ' , port) ;})
- C. serve(( port) => (
- D. console.log( 'Listening on ', port);
- E. server()
Answer: B
NEW QUESTION # 119
Which two console logs output NaN?
Choose 2 answers | |
- A. console.log(10 / Number('5) ) ;
- B. console.log(10 / 0);
- C. console.log(parseInt ' ("two')) ;
- D. console.loeg(10 / 'five');
Answer: C,D
NEW QUESTION # 120
......
JavaScript-Developer-I Exam Dumps Pass with Updated 2024 Certified Exam Questions: https://www.passcollection.com/JavaScript-Developer-I_real-exams.html
JavaScript-Developer-I Exam Questions - Real & Updated Questions PDF: https://drive.google.com/open?id=17sqxApvQy9KdEsTJuhi93Ek_Yvsg-peC

