A developer is leading the creation of a new browser application that will serve a single
page application. The team wants to use a new web framework Minimalsit.js. The Lead
developer wants to advocate for a more seasoned web framework that already has a
community around it.
Which two frameworks should the lead developer advocate for?
Choose 2 answers
A.
Vue
B.
Angular
C.
Koa
D.
Express
Angular
Express
A developer implements a function that adds a few values.
Function sum(num) {
If (num == undefined) {
Num =0;
}
Return function( num2, num3){
If (num3 === undefined) {
Num3 =0 ;
}
Return num + num2 + num3;
}
}
Which three options can the developer invoke for this function to get a return value of 10 ?
Choose 3 answers
A.
Sum () (20)
B.
Sum (5, 5) ()
C.
sum() (5, 5)
D.
sum(5)(5)
E.
sum(10) ()
sum() (5, 5)
sum(5)(5)
developer publishes a new version of a package with new features that do not break
backward compatibility. The previous version number was 1.1.3.
Following semantic versioning format, what should the new package version number
be?
A.
2.0.0
B.
1.2.3
C.
1.1.4
D.
1.2.0
1.2.0
A developer receives a comment from the Tech Lead that the code given below has error: const monthName = ‘July’;
const year = 2019;
if(year === 2019) {
monthName = ‘June’;
}
Which line edit should be made to make this code run?
A.
01 let monthName =’July’;
B.
02 let year =2019;
C.
02 const year = 2020;
D.
03 if (year == 2019) {
01 let monthName =’July’;
A developer creates a class that represents a blog post based on the requirement that a
Post should have a body author and view count.
The Code shown Below:
Class Post {
// Insert code here
This.body =body
This.author = author;
this.viewCount = viewCount;
}
}
Which statement should be inserted in the placeholder on line 02 to allow for a variable to
be set
to a new instanceof a Post with the three attributes correctly populated?
A.
super (body, author, viewCount) {
B.
Function Post (body, author, viewCount) {
C.
constructor (body, author, viewCount) {
D.
constructor() {
constructor (body, author, viewCount) {
A developer wants to create an object from a function in the browser using the code below: Function Monster() { this.name = ‘hello’ };
Const z = Monster(); What happens due to lack of the new keyword on line 02?
A.
The z variable is assigned the correct object.
B.
The z variable is assigned the correct object but this.name remains undefined.
C.
Window.name is assigned to ‘hello’ and the variable z remains undefined.
D.
Window.m is assigned the correct object.
Window.name is assigned to ‘hello’ and the variable z remains undefined.
A developer creates a generic function to log custom messages in the console. To do this,
the function below is implemented.
01 function logStatus(status){
02 console./*Answer goes here*/{‘Item status is: %s’, status};
03 } Which three console logging methods allow the use of string substitution in line 02?
A.
Assert
B.
Log
C.
Message
D.
Info
E.
ErrorA
Assert
Info
Which code statement below correctly persists an objects in local Storage ?
A.
const setLocalStorage = (storageKey, jsObject) => {
window.localStorage.setItem(storageKey, JSON.stringify(jsObject));
}
B.
const setLocalStorage = ( jsObject) => {
window.localStorage.connectObject(jsObject));
}
C.
const setLocalStorage = ( jsObject) => {
window.localStorage.setItem(jsObject);
}
D.
const setLocalStorage = (storageKey, jsObject) => {
window.localStorage.persist(storageKey, jsObject);
}
const setLocalStorage = (storageKey, jsObject) => {
window.localStorage.setItem(storageKey, JSON.stringify(jsObject));
}
Which statement phrases successfully?
A.
JSON.parse ( ‘ foo ’ );
B.
JSON.parse ( “ foo ” );
C.
JSON.parse( “ ‘ foo ’ ” );
D.
JSON.parse(‘ “ foo ” ’);
JSON.parse(‘ “ foo ” ’);
Refer to code below:
console.log(0);
setTimeout(() => (
console.log(1);
});
console.log(2);
setTimeout(() => {
console.log(3);
), 0);
console.log(4);
In which sequence will the numbers be logged?
A.
01234
B.
02431
C.
02413
D.
13024
02413
A class was written to represent items for purchase in an online store, and a second class
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 ?
A.
This is a Scarf
Uncaught TypeError: saleItem.description is not a function
This is aScarf
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 aScarf
Uncaught TypeError: saleItem.description is not a function
This is a Shirt
This is a did counted Shirt
This is a Scarf
This is a Shirt
This is a Scarf
This is a discounted Shirt
Refer to code below:
Let first = ‘who’;
Let second = ‘what’;
Try{
Try{
Throw new error(‘Sad trombone’);
}catch (err){
First =’Why’;
}finally {
Second =’when’;
} catch (err) {
Second =’Where’;
}
What are the values for first and second once the code executes ?
A.
First is Who and second is When
B.
First is why and second is where
C.
First is who and second is where
D.
First is why and second is when
First is why and second is when
Page 8 out of 19 Pages |
Previous |