联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> Java编程Java编程

日期:2019-06-11 10:12

CS591 Quiz 1 Name: ____________________________________

1. What is printed on the console after running this snippet?

const delayed = function ( ) {

setTimeout(

function () {

let x = 42

return x}, 2000)}

console.log('starting run')

const x = delayed()

console.log('x is now', x)

console.log('ending run')

2. What does it mean to say that a function will block?

3. Once a blocked function has completed its work on a worker thread, when is it moved into the

execution queue?

4. Briefly explain how a Promise works at a high level.

5. What is a lambda function?

6. In what order does Express middleware run?

7. Correct the error in this route:

router.get('/string', function (req, res, next) {

let string = “Hey now!”;

})

8. Which HTTP verbs are typically mapped onto CRUD operations to define a RESTful

interface?

9. What are the three arguments in an Express middleware function, and what do they

represent?

10. What line must be included in a module in order for it to expose an interface?

11. What is npm, and what role does it serve?

12. What does the acronym JSON stand for?

13. Assume that you are writing a route that matches a POST of a form on the client. On what

object will the POSTed form values be found?

14. What function might you use to run a set of Promises in such a way that the function returns

only when all of the Promises have resolved?

15. How is a callback function used in JavaScript?

16. What does the command ‘npm install morgan’ accomplish?

17. What function do the backtick (`) characters provide in a line of code such as

console.log(`The value is ${val}`)

18. Why do we consider generators to be pausable functions?

19. Can the Node server run on a port other than 3000?

20. What file does the command ‘npm install’ read while running?


版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp