Summer Sale Limited Time 75% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code = simple75
Pass the Salesforce Developer JavaScript-Developer-I Questions and answers with Dumpstech
Given a value, which three options can a developer use to detect if the value is NaN?
A team at Universal Containers works on a big project and uses Yarn to deal with the project’s dependencies. A developer added a dependency to manipulate dates and pushed the updates to the remote repository. The rest of the team complains that the dependency does not get downloaded when they execute yarn.
What could be the reason for this?
Function to test:
01 const sum3 = (arr) = > {
02 if (!arr.length) return 0;
03 if (arr.length === 1) return arr[0];
04 if (arr.length === 2) return arr[0] + arr[1] ;
05 return arr[0] + arr[1] + arr[2];
06 };
Which two assert statements are valid tests for this function?
Refer to the following object:
const dog = {
firstName: ' Beau ' ,
lastName: ' Boo ' ,
get fullName() {
return this.firstName + ' ' + this.lastName;
}
};
How can a developer access the fullName property for dog?
Given the code:
const copy = JSON.stringify([new String( ' false ' ), new Boolean(false), undefined]);
What is the value of copy?
A developer has two ways to write a function:
Option A:
01 function Monster() {
02 this.growl = () = > {
03 console.log( " Grr! " );
04 }
05 }
Option B:
01 function Monster() {};
02 Monster.prototype.growl = () = > {
03 console.log( " Grr! " );
04 }
After deciding on an option, the developer creates 1000 monster objects. How many growl methods are created with Option A and Option B?
Refer to the code:
const pi = 3.1415926;
What is the data type of pi?
A page loads 50+ < div class= " ad-library-item " > elements, all ads.
Developer wants to quickly and temporarily remove them.
Options:
Given the following code:
let x = ( ' 15 ' + 10) * 2;
What is the value of x?
Refer to the code below:
const searchText = ' Yay! Salesforce is amazing! ' ;
let result1 = searchText.search(/sales/i);
let result2 = searchText.search(/sales/);
console.log(result1);
console.log(result2);
After running this code, which result is displayed on the console?