Skip to content

Instantly share code, notes, and snippets.

@anharathoi
Last active June 20, 2019 00:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anharathoi/1315999b072a011f134e2436220596fb to your computer and use it in GitHub Desktop.
Save anharathoi/1315999b072a011f134e2436220596fb to your computer and use it in GitHub Desktop.

What is ExpressJS?

  1. a programming language
  2. a web application framework
  3. an npm package
  4. a runtime

What is true for this code snippet?

const express = require('express')
const app = express()

app.get('/', (x, y) => {
  // code
})
  1. y is the request object
  2. x is the response object
  3. y is the response object
  4. 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"))
  1. [ 'Express' ]
  2. 'Express'
  3. 'React'
  4. undefined

What is the value of "mern" after the splice operation?

let mern = ["MongoDB", "Express", "React", "Node"]
let x = mern.splice(1,2)
  1. [ 'MongoDB', 'Node' ]
  2. [ 'Express', 'React' ]
  3. [ 'MongoDB', 'Express' ]
  4. [ 'React', 'Node' ]

What HTTP method do we use to update something?

  1. POST
  2. PUT
  3. POST
  4. GET

Which Express method do we use to connect to a port?

  1. .get
  2. .use
  3. .listen
  4. app()

How do we install an npm package as a development dependency?

  1. npm install [--save-prod]
  2. npm install <package-name> [--save-dev]
  3. npm add [--save-dev]
  4. 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()
  1. Bob
  2. Ben
  3. undefined
  4. Throw error

What is this in the browser environment?

  1. The window object
  2. DOM
  3. {}
  4. 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
  } 
}
  1. const { profile: { color } } = cat
  2. const { color } = cat
  3. const color = { cat }
  4. const color = cat.profile.color
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment