Free Certified JavaScript Developer I Exam Braindumps
Salesforce Certified JavaScript Developer I Questions 46–50 (page: 11)

Updated On: 10-Feb-2026

Refer to the following code:
Let obj ={
Foo: 1,
Bar: 2
}
Let output =[],
for(let something in obj{
output.push(something);
}
console.log(output);
What is the output line 11?

  1. [1,2]
  2. ["bar","foo"]
  3. ["foo","bar"]
  4. ["foo:1","bar:2"]

Answer(s): C



Refer to the code below?
Let searchString = ` look for this ';
Which two options remove the whitespace from the beginning of searchString? Choose 2 answers

  1. searchString.trimEnd();
  2. searchString.trimStart();
  3. trimStart(searchString);
  4. searchString.replace(/*\s\s*/, `');

Answer(s): B,D



Whichthree actions can be using the JavaScript browser console? Choose 3 answers:

  1. View and change DOM the page.
  2. Display a report showing the performance of a page.
  3. Run code that is not related to page.
  4. view , change, and debug the JavaScript code ofthe page.
  5. View and change security cookies.

Answer(s): A,C,D



In which situation should a developer include a try .. catch block around their function call ?

  1. The function has an error that should not be silenced.
  2. The function results in an out of memory issue.
  3. The function might raise a runtime error that needs to be handled.
  4. The function contains scheduled code.

Answer(s): C



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 new requirement 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 ?

  1. This is a ScarfUncaught TypeError: saleItem.description is not a functionThis is aScarfThis is a discounted Shirt
  2. This is a ScarfThis is a ShirtThis is a ScarfThis is a discounted Shirt
  3. This is a ScarfThis is a ShirtThis is a discounted ScarfThis is a discounted Shirt
  4. This is aScarfUncaught TypeError: saleItem.description is not a functionThis is a ShirtThis is a did counted Shirt

Answer(s): B



Viewing page 11 of 46
Viewing questions 51 - 55 out of 224 questions


Post your Comments and Discuss Salesforce Certified JavaScript Developer I exam prep with other Community members:

AI Tutor AI Tutor 👋 I’m here to help!