聯系方式

您當前位置:首頁 >> 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?


版權所有:留學生編程輔導網 2018 All Rights Reserved 聯系方式:QQ:99515681 電子信箱:[email protected]
免責聲明:本站部分內容從網絡整理而來,只供參考!如有版權問題可聯系本站刪除。

体彩22选5开奖走势图百度