ACIT-2520 Midterm Review

Create an illustration of a student studying Javascript programming, surrounded by code snippets and books, in a modern classroom setting.

ACIT-2520 Midterm Review Quiz

Test your knowledge and prepare for the ACIT-2520 midterm exam with our engaging quiz! This quiz covers essential topics in programming and Javascript, helping you to solidify your understanding of key concepts.

Key Features:

  • Multiple choice questions
  • Questions on asynchronous programming, promises, and more
  • Great for self-assessment and revision
15 Questions4 MinutesCreated by CodingFox257
Which of the following is required in order to write and execute a program?
A) A programming language
B) A run-time environment
C) A Windows PC
D) Both A and B
The entire runtime environment for Javascript is the V8 Engine
True
False
Every program needs a runtime environment in order to actually execute
True
False
Any code I write which executes in the browser will work in Node.js, but not vice-versa
True
False
Compilers perform real-time translation line-by-line of our program, whereas an interpreter goes through our entire program from top to bottom before allowing the CPU to execute the resulting code.
True
False
Which function below can be used to read a file asynchronously in Node.js
Fs.readDir
Fs.readFileSync
Fs.writeFile
Fs.readFile
When I have an asynchronous function like fs.readFile which depends on the result of an fs.writeFile operation first being completed, I should nest the fs.readFile operation inside the callback of fs.writeFile.
True
False
Every function in javascript that receives a callback function as a parameter is asynchronous
True
False
The "error-first" callback convention in Node.js is where the first parameter in our callback function is our error, and we use an if statement to check whether or not that error exists before proceeding forward. It can be seen functions like readFile, writeFile, appendFile, etc.
True
False
The higher order function is filter and the callback function is func2
The callback function is filter and the higher order function is func2
The higher order function is greaterThanTwo and the callback function is func2
The higher order function is filter and there is no callback function
Promises are an alternative way in Javascript to manage asynchronous code. They solve two major issues with callback functions. What are the two most prominent issues with callback functions? (Select all that apply)
Readability problem (Deeply Nested code in callbacks)
Cannot access global scope
Callback functions don't work with recursion
No Centralized Error Handling
If a promise object resolves, it will call our .then() handler. If the promise rejects, it will call our .catch() handler.
True
False
The possible states of a promise object are pending, rejected, or fulfilled.
True
False
We only need one single .catch for our promise chain, and if any .then's throw an error, our .catch handler will receive it.
True
False
Whatever value we return from a .then is automatically wrapped in a promise so we can change additional .thens. The value will make its way into the subsequent .then's parameter. For example, in the code below, val would have "hello" in it. someFunc().then(() => "hello").then(val => console.log(val)).catch(err => console.log(err))
True
False
{"name":"ACIT-2520 Midterm Review", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Test your knowledge and prepare for the ACIT-2520 midterm exam with our engaging quiz! This quiz covers essential topics in programming and Javascript, helping you to solidify your understanding of key concepts.Key Features:Multiple choice questionsQuestions on asynchronous programming, promises, and moreGreat for self-assessment and revision","img":"https://cdn.poll-maker.com/104-5108685/img-5hw8bwaxjhztpyvegzeqgxyv.jpg"}
Powered by: Quiz Maker