[Q64-Q89] JavaScript-Developer-I Exam Brain Dumps - Study Notes and Theory [Aug-2026]

Share

JavaScript-Developer-I Exam Brain Dumps - Study Notes and Theory [Aug-2026]

100% Guaranteed Results JavaScript-Developer-I Unlimited 149 Questions

NEW QUESTION # 64
A developer wants to use a try...catch statement to catch any error that countSheep () may throw and pass it to a handleError () function.
What is the correct implementation of the try...catch?
A)

B)

C)

D)

  • A. Option
  • B. Option
  • C. Option
  • D. Option

Answer: B


NEW QUESTION # 65
Considering type coercion, what does the following expression evaluate to?
True + '13' + NaN

  • A. ' true13NaN '
  • B. 0
  • C. ' 113Nan '
  • D. ' true13 '

Answer: A


NEW QUESTION # 66
Refer to the code below:
Let inArray =[ [ 1, 2 ] , [ 3, 4, 5 ] ];
Which two statements result in the array [1, 2, 3, 4, 5] ?
Choose 2 answers

  • A. []. Concat (... inArray);
  • B. [ ]. concat ( [ ....inArray ]);
  • C. [ ]. concat.apply(inArray, [ ]);
  • D. [ ]. Concat.apply ([ ], inArray);

Answer: A,D


NEW QUESTION # 67
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/PrincePrettyPrint. Js';
Based on the code, what must be true about the printPrice function of the PricePrettyPrint modules for this import to work?

  • A. printPrice must be an all export
  • B. printPrice must be named export
  • C. printPrice must be a multi export
  • D. printPrice must be an default export

Answer: B


NEW QUESTION # 68
Refer to the code below:

What is the value of result when Promise. race executes?

  • A. Car 3 completed the race
  • B. Car 1 crashed the race
  • C. Car 2 completed the race
  • D. Race is cancelled.

Answer: B


NEW QUESTION # 69
A Node.js server library uses events and callbacks. The developer wants to log any issues the server has at boot time.
Which code logs an error with an event?

  • A. server.on( ' error ' , (error) = > {
    console.log( ' ERROR ' , error);
    });
  • B. try {
    server.start();
    } catch(error) {
    console.log( ' ERROR ' , error);
    }
  • C. server.error( ' error) = > {
    console.log( ' ERROR ' , error);
    });
  • D. server.catch( ' error) = > {
    console.log( ' ERROR ' , error);
    });

Answer: A

Explanation:
Node.js event-based modules use the EventEmitter pattern.
The correct syntax for listening to events is:
emitter.on( ' eventName ' , callback)
The server library emits an ' error ' event, which must be listened to using .on.
Option analysis:
* A: .catch is for Promises, not EventEmitters.
* B: .error is not an EventEmitter method.
* C: Correct. Listens to the ' error ' event.
* D: try...catch only captures synchronous errors, not event-based asynchronous errors.
Therefore, the correct answer is option C .
JavaScript Knowledge References (text-only)
* The EventEmitter API uses on(event, handler) to listen for events.
* Errors emitted asynchronously cannot be caught with try...catch.
* The ' error ' event is standard for Node.js modules to signal operational errors.


NEW QUESTION # 70
Refer to the following code:

Which statement should be added to line 09 for the code to display. The boat has a capacity of 10 people?

  • A. this.size = size;
  • B. super.size = size;
  • C. super (size);
  • D. ship.size size;

Answer: A


NEW QUESTION # 71
A class was written to represent regular items and sale items. Code:
01 let regItem = new Item( ' Scarf ' , 55);
02 let saleItem = new SaleItem( ' Shirt ' , 80, .1);
03 Item.prototype.description = function() { return ' This is a ' + this.name; }
04 console.log(regItem.description());
05 console.log(saleItem.description());
06
07 SaleItem.prototype.description = function() { return ' This is a discounted ' + this.name; }
08 console.log(regItem.description());
09 console.log(saleItem.description());
What is the output?

  • A. This is a Scarf
    Uncaught TypeError: saleItem.description is not a function
    This is a Scarf
    This is a discounted Shirt
  • B. This is a Scarf
    This is a Shirt
    This is a Scarf
    This is a discounted Shirt
  • C. This is a Scarf
    This is a Shirt
    This is a discounted Scarf
    This is a discounted Shirt
  • D. This is a Scarf
    Uncaught TypeError: saleItem.description is not a function
    This is a Shirt
    This is a discounted Shirt

Answer: B

Explanation:
* At line 03, the developer assigns:
Item.prototype.description = function() { return ' This is a ' + this.name; } This affects all objects whose prototype chain includes Item.prototype .
* regItem inherits from Item # gets this method.
* saleItem, as an instance of SaleItem, also inherits Item.prototype (since SaleItem uses prototype inheritance from Item), so it also has this method at this moment.
Outputs at lines 04 and 05:
* regItem.description() # " This is a Scarf "
* saleItem.description() # " This is a Shirt "
* At line 07, the developer overrides the method on SaleItem.prototype :
SaleItem.prototype.description = function() {
return ' This is a discounted ' + this.name;
}
From this point:
* regItem still uses the Item.prototype version
* saleItem uses the overridden SaleItem.prototype version
Outputs at lines 08 and 09:
* regItem.description() # " This is a Scarf "
* saleItem.description() # " This is a discounted Shirt "
Combining all results:
This is a Scarf
This is a Shirt
This is a Scarf
This is a discounted Shirt
This matches option B .
JavaScript Knowledge References (text-only)
* Objects created from constructor functions use prototype chaining.
* Overriding a subclass prototype method does not affect the parent class prototype.
* Instances inherit the most specific version of the method on their prototype chain.


NEW QUESTION # 72
A developer creates a class that represents a news story based on the requirements that a Story should have a body, author, and view count. The code is shown below:
01 class Story {
02 // Insert code here
03 this.body = body;
04 this.author = author;
05 this.viewCount = viewCount;
06 }
07 }
Which statement should be inserted in the placeholder on line 02 to allow for a variable to be set to a new instance of a Story with the three attributes correctly populated?

  • A. constructor(body, author, viewCount) {
  • B. constructor() {
  • C. super(body, author, viewCount) {
  • D. function Story(body, author, viewCount) {

Answer: A

Explanation:
In ES6 class syntax, the special method used to initialize a new instance is called constructor.
* A class definition syntax:
class ClassName {
constructor(param1, param2) {
this.prop1 = param1;
this.prop2 = param2;
}
}
* The constructor method:
* Is called automatically when you create a new instance with new ClassName(...).
* Receives the arguments passed in the new expression.
* Assigns values to this to set instance properties.
* Applying this to Story
We want to be able to write:
const article = new Story( ' Some body ' , ' Author Name ' , 100);
and have:
* article.body === ' Some body '
* article.author === ' Author Name '
* article.viewCount === 100
To achieve this, the class must have:
class Story {
constructor(body, author, viewCount) {
this.body = body;
this.author = author;
this.viewCount = viewCount;
}
}
So the correct line 02 is:
constructor(body, author, viewCount) {
* Why the other options are incorrect
* A. constructor() {
* This defines a constructor with no parameters.
* The lines inside the constructor use body, author, and viewCount, which would be undefined unless they exist in an outer scope (they normally do not).
* This would lead to the instance properties being set to undefined in normal usage.
* B. super(body, author, viewCount) {
* super(...) is used inside a constructor of a subclass to call the parent class constructor.
* You cannot use super(...) { as a method definition; this is invalid syntax in a class body.
* Additionally, Story as given is not shown extending any class, so super is inappropriate here.
* C. function Story(body, author, viewCount) {
* Inside a class definition, you do not use the function keyword to define methods.
* function Story(...) here would be invalid syntax in a class body.
* Even if it were allowed, the special constructor method for a class is named constructor, not the class name.
Therefore, only:
constructor(body, author, viewCount) {
correctly declares the constructor for the Story class and ensures instances created with new Story(body, author, viewCount) have all three properties populated.
References / Study Guide concepts (no links):
* ES6 class syntax
* constructor method in classes
* this and instance properties in classes
* Difference between class constructors and regular functions
* Invalid use of super and function inside class bodies


NEW QUESTION # 73
A developer needs to test this functions:

Which two assert statements are valid tests for this function?

  • A. Console.assert(sum3 ([-3, 2]) -1) ;
  • B. Console.assert(sum3 (['hello' 2, 3, 4]) NaN);
  • C. Console.assert(sum3((1, '2' ]) 12 );
  • D. Console.assert(sum3([0]) 0) ;

Answer: A,C


NEW QUESTION # 74
Which option is true about the strict mode in imported modules?

  • A. Add the statement use strict =false; before any other statements in the module to enable not- strict mode.
  • B. Add the statement use non-strict, before any other statements in the module to enable not-strict mode.
  • C. Imported modules are in strict mode whether you declare them as such or not.
  • D. You can only reference notStrict() functions from the imported module.

Answer: D


NEW QUESTION # 75
Refer to the following code block:

What is the value of output after the code executes?

  • A. 0
  • B. 1
  • C. 2
  • D. 3

Answer: A


NEW QUESTION # 76
Refer to the following code (correcting the missing template literal backticks):
let codeName = ' Bond ' ;
let sampleText = `The name is ${codeName}, Jim ${codeName}`;
A developer is trying to determine if a certain substring is part of a string.
Which three code statements return true?

  • A. sampleText.includes( ' The ' , 1);
  • B. sampleText.includes( ' Jim ' , 4);
  • C. sampleText.substring( ' Jim ' );
  • D. sampleText.indexOf( ' Bond ' ) !== -1;
  • E. sampleText.includes( ' Jim ' );

Answer: B,D,E

Explanation:
First, compute sampleText:
let codeName = ' Bond ' ;
let sampleText = `The name is ${codeName}, Jim ${codeName}`;
The template literal evaluates to:
" The name is Bond, Jim Bond "
Now evaluate each statement:
Option A: sampleText.includes( ' Jim ' );
* String.prototype.includes(substring) returns true if substring occurs anywhere in the string.
* sampleText clearly contains " Jim " ( " The name is Bond, Jim Bond " ).
* So this returns true.
Option B: sampleText.includes( ' The ' , 1);
* includes(searchString, position) starts searching from the given position index.
* " The name is Bond, Jim Bond " has " The " starting at index 0.
* Starting search at index 1 means " The " at index 0 is not considered, and there is no second " The " .
* So this returns false.
Option C: sampleText.includes( ' Jim ' , 4);
* " Jim " appears after " The name is Bond, " which is longer than 4 characters; the index of " Jim " is well past 4.
* So when searching from index 4, " Jim " is still found.
* This returns true.
Option D: sampleText.indexOf( ' Bond ' ) !== -1;
* String.prototype.indexOf(substring) returns:
* -1 if the substring is not found,
* Otherwise, the starting index of the first occurrence.
* " Bond " appears twice in " The name is Bond, Jim Bond " .
* So sampleText.indexOf( ' Bond ' ) is some non-negative index (for the first occurrence).
* Therefore indexOf( ' Bond ' ) !== -1 is true.
Option E: sampleText.substring( ' Jim ' );
* substring expects numeric indexes: substring(startIndex, endIndex?).
* If given a string " Jim " as the argument, JavaScript coerces it to a number:
* Number( ' Jim ' ) # NaN
* NaN for startIndex is treated as 0.
* So sampleText.substring( ' Jim ' ) is effectively sampleText.substring(0), which returns the full string " The name is Bond, Jim Bond " .
* This is a string , not a boolean. The question asks "which code statements return true?"
* This statement returns a string, not the boolean value true.
Thus, the three statements that actually return true (boolean) are:
The answer: A, C, D
Study Guide / Concept References (no links):
* Template literals and ${} interpolation
* String.prototype.includes(searchString, position?)
* String.prototype.indexOf(substring) and checking for !== -1
* String.prototype.substring(start, end?) and argument coercion
* Boolean vs non-boolean return types in string methods


NEW QUESTION # 77
developer creates a new web server that uses Node.js. It imports a server library that uses events and callbacks for handling server functionality.
The server library is imported with require and is made available to the code by a variable named server. The developer wants to log any issues that the server has while booting up.
Given the code and the information the developer has, which code logs an error at boost with an event?

  • A. Server.on ('error', (error) => {
    console.log('ERROR', error);
    });
  • B. Server.error ((server) => {
    console.log('ERROR', error);
    });
  • C. Try{
    server.start();
    } catch(error) {
  • D. Server.catch ((server) => {
    console.log('ERROR', error);
    });

Answer: A

Explanation:
console.log('ERROR', error);
}


NEW QUESTION # 78
developer uses the code below to format a date.

After executing, what is the value of formattedDate?

  • A. May 10, 2020
  • B. June 10, 2020
  • C. October 05, 2020
  • D. November 05, 2020

Answer: B


NEW QUESTION # 79
Which statement accurately describes an aspect of promises?

  • A. .then() cannot be added after a catch.
  • B. .then() manipulates and returns the original promise.
  • C. Arguments for the callback function passed to .then() are optional.
  • D. In a.then() function, returning results is not necessary since callbacks will catch the result of a previous promise.

Answer: C


NEW QUESTION # 80
Refer to the code below:
function foo () {
const a =2;
function bat() {
console.log(a);
}
return bar;
}
Why does the function bar have access to variable a ?

  • A. Hoisting
  • B. Outer function's scope
  • C. Prototype chain
  • D. Inner function's scope

Answer: B


NEW QUESTION # 81
developer creates a new web server that uses Node.js. It imports a server library that uses events and callbacks for handling server functionality.
The server library is imported with require and is made available to the code by a variable named server. The developer wants to log any issues that the server has while booting up.
Given the code and the information the developer has, which code logs an error at boost with an event?

  • A. Server.on ('error', (error) => {
    console.log('ERROR', error);
    });
  • B. Server.error ((server) => {
    console.log('ERROR', error);
    });
  • C. Try{
    server.start();
    } catch(error) {
    console.log('ERROR', error);
    }
  • D. Server.catch ((server) => {
    console.log('ERROR', error);
    });

Answer: A


NEW QUESTION # 82
Refer to the code below:

Which code executes syhello once, two minutes from now?

  • A. delay (sayhello, 120000) ;
  • B. SetTimeout (sayhello( ), 120000) ;
  • C. SetInterval (sayhello, 120000) ;
  • D. SetTimeout (sayhello, 120000) ;

Answer: B


NEW QUESTION # 83
Refer to the following code that imports a module named utils:
import (foo, bar) from '/path/Utils.js';
foo() ;
bar() ;
Which two implementations of Utils.js export foo and bar such that the code above runs without error?
Choose 2 answers

  • A. const foo = () => { return 'foo' ; }
    const bar = () => { return 'bar' ; }
    export { bar, foo }
  • B. Export default class {
    foo() { return 'foo' ; }
    bar() { return 'bar' ; }
    }
  • C. // FooUtils.js and BarUtils.js exist
    Import (foo) from '/path/FooUtils.js';
    Import (boo) from ' /path/NarUtils.js';
  • D. const foo = () => { return 'foo';}
    const bar = () => {return 'bar'; }
    Export default foo, bar;

Answer: A,B


NEW QUESTION # 84
Refer to the HTML below:

Which JavaScript statement results in changing " The Lion."?

  • A. document.querySelector('$main li:second-child').innerHTML = " The Lion ';
  • B. document.querySelector('$main li:nth-child(2)'),innerHTML = " The Lion. ';
  • C. document.querySelectorAll('$main $TONY').innerHTML = '" The Lion
  • D. document.querySelector('$main li.Tony').innerHTML = '" The Lion ';

Answer: C


NEW QUESTION # 85
01 function changeValue(obj) {
02 obj.value = obj.value / 2;
03 }
04 const objA = {value: 10};
05 const objB = objA;
06
07 changeValue(objB);
08 const result = objA.value;
What is the value of result after the code executes?

  • A. low
  • B. 0
  • C. 1
  • D. undefined

Answer: C

Explanation:
* objA is { value: 10 }.
* objB = objA; # both variables reference the same object .
* changeValue(objB);:
obj.value = obj.value / 2; // modifies the shared object
So:
* objA.value becomes 10 / 2 = 5.
Thus result is 5.


NEW QUESTION # 86
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 02 assertion fails.
  • B. The line 02 assertion passes.
  • C. The line 05 assertion passes.
  • D. The line 05 assertion fails.

Answer: B,D


NEW QUESTION # 87
A developer wants to define a function log to be used a few times on a single-file JavaScript script.
01 // Line 1 replacement
02 console.log('"LOG:', logInput);
03 }
Which two options can correctly replace line 01 and declare the function for use?
Choose 2 answers

  • A. const log = (logInput) => {
  • B. function leg(logInput) {
  • C. const log(loginInput) {
  • D. function log = (logInput) {

Answer: A,B


NEW QUESTION # 88
Refer to the following code:
01 let obj = {
02 foo: 1,
03 bar: 2
04 }
05 let output = []
06
07 for (let something of obj) {
08 output.push(something);
09 }
10
11 console.log(output);
What is the value of output on line 11?

  • A. An error will occur due to the incorrect usage of the for_of statement on line 07.
  • B. [ " foo:1 " , " bar:2 " ]
  • C. [1, 2]
  • D. [ " foo " , " bar " ]

Answer: A

Explanation:
The key line is:
for (let something of obj) {
In JavaScript:
* for...of is used to iterate over iterable objects, such as:
* Arrays
* Strings
* Maps
* Sets
* Other objects that implement a [Symbol.iterator] method.
Plain JavaScript objects created with object literal {} are not iterable by default . They do not have [Symbol.
iterator], so using for...of directly on them causes a runtime error.
Specifically:
for (let something of obj) { ... }
will throw a TypeError similar to:
obj is not iterable
Therefore, the loop body never executes, and console.log(output); is never reached without an error.
Why other options are incorrect:
* B. [1, 2]
* To get [1, 2], you could use Object.values(obj) and iterate that array.
* But here, for...of obj never yields values because it throws an error.
* C. [ " foo " , " bar " ]
* To get property names, you could use Object.keys(obj) with for...of.
* Again, the code does not do that; it incorrectly tries to iterate the object directly.
* D. [ " foo:1 " , " bar:2 " ]
* You would need both keys and values, combining them manually.
* The given code does not implement such logic and fails before pushing anything into output.
Hence, the correct answer is:
The answer: A
Study Guide / Concept References (no links):
* Difference between for...of and for...in
* Iterables in JavaScript and [Symbol.iterator]
* Plain objects {} are not iterable by default
* Correct patterns to iterate object keys/values (Object.keys, Object.values, Object.entries)


NEW QUESTION # 89
......

JavaScript-Developer-I Dumps PDF - Want To Pass JavaScript-Developer-I Fast: https://www.examslabs.com/Salesforce/Salesforce-Developer/best-JavaScript-Developer-I-exam-dumps.html

JavaScript-Developer-I Practice Exam Dumps Exam: https://drive.google.com/open?id=14vvvl46yWDaNma_yqhFWM1BXFIxvEQ0Z