a programming language
a web application framework
an npm package
a runtime
What is true for this code snippet?
const express = require ( 'express' )
const app = express ( )
app . get ( '/' , ( x , y ) => {
// code
} )
y is the request object
x is the response object
y is the response object
x and y are defined by you
What is x in this code snippet?
let mern = [ "MongoDB" , "Express" , "React" , "Node" ]
let x = mern . filter ( item => ( item === "Express" ) )
[ 'Express' ]
'Express'
'React'
undefined
What is the value of "mern" after the splice operation?
let mern = [ "MongoDB" , "Express" , "React" , "Node" ]
let x = mern . splice ( 1 , 2 )
[ 'MongoDB', 'Node' ]
[ 'Express', 'React' ]
[ 'MongoDB', 'Express' ]
[ 'React', 'Node' ]
What HTTP method do we use to update something?
POST
PUT
POST
GET
Which Express method do we use to connect to a port?
.get
.use
.listen
app()
How do we install an npm package as a development dependency?
npm install [--save-prod]
npm install <package-name> [--save-dev]
npm add [--save-dev]
gem install
What will be user2.printName()?
let user1 = {
name : "Bob" ,
printName : function ( ) {
console . log ( this . name )
}
}
let user2 = {
name : "Ben"
}
user2 . printName = user1 . printName
user2 . printName ( )
Bob
Ben
undefined
Throw error
What is this
in the browser environment?
The window object
DOM
{}
the browser object
How do we get the color out of the following code snippet using object destructuring?
let cat = {
profile : {
color : 'white' ,
weight : 7
}
}
const { profile: { color } } = cat
const { color } = cat
const color = { cat }
const color = cat.profile.color