Verified JS-Dev-101 dumps Q&As - 100% Pass from ExamsTorrent
Pass JS-Dev-101 Exam in First Attempt Guaranteed 2026 Dumps!
Salesforce JS-Dev-101 Exam Syllabus Topics:
| Topic | Details |
|---|---|
| Topic 1 |
|
| Topic 2 |
|
| Topic 3 |
|
| Topic 4 |
|
NEW QUESTION # 20
A developer copied a JavaScript object:
How does the developer access dan's forstName,lastName? Choose 2 answers
- A. dan,name
- B. dan,name ( )
- C. dan,firstname ( ) + dan, lastName ( )
- D. dan, firstName =dan.lastName
Answer: B,D
NEW QUESTION # 21
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.slice(0, 5);
- B. Let arr2 = Array.from(arr1);
- C. Let arr2 = arr1;
- D. Let arr2 = arr1.sort();
Answer: A,B
NEW QUESTION # 22
A 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 negative
- B. True negative
- C. False positive
- D. True positive
Answer: C
Explanation:
Definitions in testing context (treating "positive" as "test reports a bug/failure"):
True positive: System has a bug; test correctly fails.
False positive: System is correct; test fails (reports a bug that isn't actually a bug).
True negative: System has a bug; test correctly passes indicating "no success" in detection context (less common phrasing here).
False negative: System has a bug; test incorrectly passes (missed bug).
Here:
The real requirement, as stated, is to verify the existence of the checkout button.
The button still exists (<button>Checkout</button>), so the system behavior is correct regarding that requirement.
The test, however, is checking for an overly specific condition (class="blue"), which is not actually part of the stated requirement.
The test fails, saying there is a problem (no button with class="blue"), even though from the requirement standpoint, the checkout button is present.
So:
No real bug concerning presence of checkout button.
Test reports a failure → a false positive.
Therefore, the correct category is D, False positive.
NEW QUESTION # 23
A developer at Universal Containers creates a new landing page based on HTML, CSS, and JavaScript TO ensure that visitors have a goodexperience, a script named personaliseContext needs to be executed when the webpage is fully loaded (HTML content and all related files ), in order to do some custom initialization.
Which statement should be used to call personalizeWebsiteContent based onthe above business requirement?
- A. window.addEventListener('onload', personalizeWebsiteContext);
- B. window.addEventListener('load',personalizeWebsiteContext);
- C. document.addEventListener(''onDOMContextLoaded', personalizeWebsiteContext);
- D. Document.addEventListener('''DOMContextLoaded' , personalizeWebsiteContext);
Answer: B
NEW QUESTION # 24
Refer to the following object.
How can a developer access the fullName property for dog?
- A. Dog, get,fullName
- B. Dog.fullName ( )
- C. Dog, function, fullName
- D. Dog.fullName
Answer: D
NEW QUESTION # 25
Refer to the code below?
Let searchString = ' look for this ';
Which two options remove the whitespace from the beginning of searchString?
Choose 2 answers
- A. searchString.trimEnd();
- B. trimStart(searchString);
- C. searchString.replace(/*\s\s*/, '');
- D. searchString.trimStart();
Answer: C,D
NEW QUESTION # 26
CRefer to the code below:
```javascript
let strNumber = '12345';
```
Which code snippet shows a correct way to convert this string to an integer?
- A. let numberValue = Number(textVelue);
- B. let numberValue = (stunber) textveluer
- C. let numberValue = textvalue.cornteger();
- D. let numberValue = Integer(strNumber);
Answer: A
NEW QUESTION # 27
Given the code below:
Which three code segments result in a correct conversion from number to string? Choose 3 answers
- A. let strValue = numValue.toText ();
- B. let strValue = numValue. toString();
- C. let strValue = * * 4 numValue;
- D. let scrValue = String(numValue);
- E. let strValue = (String)numValue;
Answer: B,C,D
NEW QUESTION # 28
Which three browser specific APIs are available for developers to persist data between page loads ?
Choose 3 answers
- A. Global variables
- B. localStorage.
- C. Cookies
- D. IIFEs
- E. indexedDB
Answer: B,D,E
NEW QUESTION # 29
Given the JavaScript below:
Which code should replace the placeholder comment on line 06 to hide accounts that do not match the search string?
- A. 'Block' : 'none'
- B. 'Visible : 'hidden'
- C. 'Hidden, visible
- D. 'None' : 'block'
Answer: A
NEW QUESTION # 30
Given the code below:
Setcurrent URL ();
console.log('The current URL is: ' +url );
functionsetCurrentUrl() {
Url = window.location.href:
What happens when the code executes?
- A. The url variable has local scope and line 02 executes correctly.
- B. The url variable has global scope and line 02 executes correctly.
- C. The url variable has local scope and line 02 throws an error.
- D. The url variable has global scope and line 02 throws an error.
Answer: B
NEW QUESTION # 31
Given:
const str = 'Salesforce';
Which two statements result in 'Sales'?
- A. str.substr(0, 5);
- B. str.substring(0, 5);
- C. str.substr(1, 5);
- D. str.substring(1, 5);
Answer: A,B
Explanation:
Comprehensive and Detailed Explanation From Exact Extract JavaScript Knowledge:
str = 'Salesforce'
Index positions:
S(0) a(1) l(2) e(3) s(4) f(5) o(6) r(7) c(8) e(9)
substring(start, end)
Start index inclusive, end index exclusive.
str.substring(0, 5) → characters at indices 0-4 → "Sales"
str.substring(1, 5) → indices 1-4 → "ales"
substr(start, length)
Start index, then number of characters.
str.substr(0, 5) → 5 characters starting at index 0 → "Sales"
str.substr(1, 5) → 5 characters from index 1 → "alesf"
So the expressions that return "Sales" are A and C.
________________________________________
NEW QUESTION # 32
Refer to the code:
const pi = 3.1415926;
What is the data type of pi?
- A. Float
- B. Decimal
- C. Number
- D. Double
Answer: C
Explanation:
________________________________________
Comprehensive and Detailed Explanation From Exact Extract JavaScript Knowledge JavaScript has one numeric data type for all real numbers, whether integers or decimals.
This type is simply called:
Number
It follows the IEEE 754 double-precision floating-point standard internally, but JavaScript does not expose separate types like float, double, or decimal.
Therefore:
It is not Float → JavaScript does not have float primitives.
It is not Double → this refers to the underlying IEEE 754 representation, but JavaScript's type is still just "Number." It is not Decimal → JavaScript has no built-in decimal type.
The correct answer is Number.
________________________________________
JavaScript Knowledge Reference (text-only)
JavaScript has a single numeric type: Number.
All numbers-integers, fractions, floating point-use the Number type.
NEW QUESTION # 33
A developer creates a simple webpage with an input field. When a user enters text and clicks the button, the actual value must be displayed in the console:
HTML:
<input type="text" value="Hello" name="input">
<button type="button">Display</button>
JavaScript:
01 const button = document.querySelector('button');
02 button.addEventListener('click', () => {
03 const input = document.querySelector('input');
04 console.log(input.getAttribute('value'));
05 });
When the user clicks the button, the output is always "Hello".
What needs to be done to make this code work as expected?
- A. Replace line 02 with button.addEventListener("onclick", function() {
- B. Replace line 03 with const input = document.getElementByIdName('input');
- C. Replace line 04 with console.log(input.value);
- D. Replace line 02 with button.addCallback("click", function() {
Answer: C
Explanation:
________________________________________
Comprehensive and Detailed Explanation From Exact Extract JavaScript Knowledge getAttribute('value') This returns the initial HTML attribute, not the live, updated value.
Even if the user edits the text, the value attribute remains "Hello" because HTML attributes do not update dynamically.
Input elements have a property value that always reflects the live current text inside the field.
So:
input.value
returns the user-entered value.
Therefore, line 04 must use the property, not the attribute:
console.log(input.value);
This ensures the updated input value is displayed.
________________________________________
JavaScript knowledge references (text-only)
HTML attributes are static and retrieved using getAttribute().
DOM element properties (like value) represent the current live state.
Input value changes update the .value property, not the attribute.
NEW QUESTION # 34
Refer to the code below:
01 const exec = (item, delay) =>{
02 newPromise(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 ( ). done(function(data){return data;});
- B. runParallel () .then(data);
- C. Async runParallel () .then(data);
- D. runParallel () .then(function(data)return data
Answer: A,D
NEW QUESTION # 35
......
JS-Dev-101 Dumps Full Questions - Exam Study Guide: https://www.examstorrent.com/JS-Dev-101-exam-dumps-torrent.html
Use Real JS-Dev-101 - 100% Cover Real Exam Questions: https://drive.google.com/open?id=1hOrBjbYc0NKKV6LtpZLH0nkqgQ1AlFDX