JavaScript-Developer-I Exam Questions

Total 221 Questions

Last Updated Exam : 22-Nov-2024

Refer to HTML below:
<div id =”main”>
<div id = “ card-00”>This card is smaller.</div>
<div id = “card-01”>The width and height of this card is determined by its
contents.</div>
</div>
Which expression outputs the screen width of the element with the ID card-01?


A.

document.getElementById(‘ card-01 ’).getBoundingClientRest().width


B.

document.getElementById(‘ card-01 ’).style.width


C.

document.getElementById(‘ card-01 ’).width


D.

document.getElementById(‘ card-01 ’).innerHTML.lenght*e





A.
  

document.getElementById(‘ card-01 ’).getBoundingClientRest().width



Which option is a core Node,js module?


A.

Path


B.

Ios


C.

Memory


D.

locate





A.
  

Path



A developer is wondering whether to use, Promise.then or Promise.catch, especially
when a Promise throws an error?
Which two promises are rejected?
Which 2 are correct?


A.

Promise.reject(‘cool error here’).then(error => console.error(error));


B.

Promise.reject(‘cool error here’).catch(error => console.error(error));


C.

New Promise((resolve, reject) => (throw ‘cool error here’}).catch(error =>
console.error(error)) ;


D.

New Promise(() => (throw ‘cool error here’}).then(null, error => console.error(error)));





B.
  

Promise.reject(‘cool error here’).catch(error => console.error(error));



C.
  

New Promise((resolve, reject) => (throw ‘cool error here’}).catch(error =>
console.error(error)) ;



Refer to the code below:
Let str = ‘javascript’;
Str[0] = ‘J’;
Str[4] = ’S’;
After changing the string index values, the value of str is ‘javascript’. What is the reason
for this value:


A.

A. Non-primitive values are mutable.


B.

Non-primitive values are immutable.


C.

Primitive values are mutable.


D.

Primitive values are immutable.





D.
  

Primitive values are immutable.



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


A.

View and change DOM the page.


B.

Display a report showing the performance of a page.


C.

Run code that is not related to page.


D.

view , change, and debug the JavaScript code of the page.


E.

View and change security cookies





A.
  

View and change DOM the page.



C.
  

Run code that is not related to page.



D.
  

view , change, and debug the JavaScript code of the page.



Refer to the code below:
console.log(‘’start);
Promise.resolve(‘Success’) .then(function(value){
console.log(‘Success’);
});
console.log(‘End’);
What is the output after the code executes successfully?


A.

End
Start
Success


B.

Start
Success
End


C.

Start
End
Success


D.

Success
Start
End





C.
  

Start
End
Success



Refer to the following array:
Let arr = [ 1,2, 3, 4, 5];
Which three options result in x evaluating as [3, 4, 5] ?
Choose 3 answers.


A.

Let x= arr.filter (( a) => (a<2));


B.

Let x= arr.splice(2,3);


C.

Let x= arr.slice(2);


D.

Let x= arr.filter((a) => ( return a>2 ));


E.

Let x = arr.slice(2,3);





B.
  

Let x= arr.splice(2,3);



C.
  

Let x= arr.slice(2);



D.
  

Let x= arr.filter((a) => ( return a>2 ));



Refer to the code below:
Const resolveAfterMilliseconds = (ms) => Promise.resolve (
setTimeout (( => console.log(ms), ms ));
Const aPromise = await resolveAfterMilliseconds(500);
Const bPromise = await resolveAfterMilliseconds(500);
Await aPromise, wait bPromise;
What is the result of running line 05?


A.

aPromise and bPromise run sequentially.


B.

Neither aPromise or bPromise runs.


C.

aPromise and bPromise run in parallel.


D.

Only aPromise runs.





B.
  

Neither aPromise or bPromise runs.



Refer to following code:
class Vehicle {
constructor(plate) {
This.plate =plate;
}
}
Class Truck extends Vehicle {
constructor(plate, weight) {
//Missing code
This.weight = weight;
}
displayWeight() {
console.log(‘The truck ${this.plate} has a weight of ${this.weight} lb.’);}}
Let myTruck = new Truck(‘123AB’, 5000);
myTruck.displayWeight();
Which statement should be added to line 09 for the code to display ‘The truck 123AB has a
weight of 5000lb.’?


A.

Super.plate =plate;


B.

super(plate);


C.

This.plate =plate;


D.

Vehicle.plate = plate;





B.
  

super(plate);



Which function should a developer use to repeatedly execute code at a fixed interval ?


A.

setIntervel


B.

setTimeout


C.

setPeriod


D.

setInteria





A.
  

setIntervel




Page 4 out of 23 Pages
Previous