Salesforce JavaScript-Developer-I - Salesforce Certified JavaScript Developer (JS-Dev-101)
The developer wants to test the array shown:
const arr = Array(5).fill(0)
Which two tests are the most accurate for this array ?
Choose 2 answers:
At Universal Containers, every team has its own way of copying JavaScript objects. The
code
Snippet shows an implementation from one team:
Function Person() {
this.firstName = “Johnâ€;
this.lastName = ‘Doe’;
This.name =() => (
console.log(‘Hello $(this.firstName) $(this.firstName)’);
)}
Const john = new Person ();
Const dan =JSON.parse(JSON.stringify(john));
dan.firstName =’Dan’;
dan.name();
What is the Output of the code execution?
A developer creates a simple webpage with an input field. When a user enters text in
the inputfield and clicks the button, the actual value of the field must be displayed in the
console.
Here is the HTML file content:
The developer wrote the javascript codebelow:
Const button = document.querySelector(‘button’);
button.addEvenListener(‘click’, () => (
Const input = document.querySelector(‘input’);
console.log(input.getAttribute(‘value’));
When the user clicks the button, the output is always “Helloâ€.
What needs to be done make this code work as expected?
Refer to the code below:
| Click me! |




