click below
click below
Normal Size Small Size show me how
IT0063 - F3&F4
Formative 3 and 4 Advanced Web Design
| Question | Answer |
|---|---|
| What does async do in front of a function? | ✅ Marks it as asynchronous |
| The keyword used to mark a function as asynchronous. | ✅ async |
| The programming model in JavaScript where only one thread executes code at a time. | ✅ Single-threaded |
| Callbacks were the first method for handling asynchronous operations in JavaScript. | ✅ True |
| The oldest method for handling asynchronous operations in JavaScript. | ✅ Callbacks |
| Async/await is syntactic sugar over Promises, making async code look synchronous. | ✅ True |
| The async keyword marks a function as asynchronous, while await pauses execution until the Promise resolves. | ✅ True |
| Using sequential await calls instead of Promise.all() results in: | ✅ Slower execution |
| Using sequential await calls is faster than running Promises in parallel with Promise.all(). | ✅ False |
| The method used to run multiple Promises in parallel and wait for all to complete. | ✅ Promise.all() |
| The Promise method that returns the first Promise to settle, whether fulfilled or rejected. | ✅ Promise.race() |
| Promise.race() returns: | ✅ The first Promise to settle |
| The Promise method that returns the first Promise to fulfill, ignoring rejected Promises. | ✅ Promise.any() |
| Promises can have which states? | ✅ Pending, Fulfilled, Rejected |
| The three states a Promise can have. | ✅ Pending, Fulfilled, Rejected |
| The type of class field that cannot be accessed from outside the class. | ✅ Private class field |
| Which of the following is true about private class fields? | ✅ They are declared with # and cannot be accessed outside the class |
| Private class fields in JavaScript are accessible outside of the class using this.#fieldName. | ✅ False |
| Optional chaining (?.) in JavaScript throws an error if any property in the chain is undefined. | ✅ False |
| What does optional chaining (?.) do in JavaScript? | ✅ Returns undefined if any property in the chain is missing |
| The operator that allows you to safely access deeply nested object properties without causing an error. | ✅ Optional chaining (?.) |
| Nullish coalescing (??) is used to: | ✅ Replace only null or undefined with a default |
| The operator used to provide a default value only when a variable is null or undefined. | ✅ Nullish coalescing operator (??) |
| The syntax used to merge arrays or objects in modern JavaScript. | ✅ Spread operator (...) |
| Which of these operators is used to merge arrays or objects? | ✅ Spread operator (...) |
| The spread operator (...) can be used to merge arrays and objects. | ✅ True |
| Destructuring in JavaScript: | ✅ Extracts values from arrays or objects into variables |
| The syntax used to extract values from arrays or objects into variables. | ✅ Destructuring |
| Destructuring cannot provide default values for object properties. | ✅ False |
| The module pattern is used for: | ✅ Encapsulation and privacy |
| The feature that allows using await outside of async functions in modules. | ✅ Top-level await |
| Top-level await allows: | ✅ Awaiting outside async functions in modules |
| Frameworks help manage the DOM, state, routing, and optimize re-renders. | ✅ True |
| Frameworks are strictly necessary to build any JavaScript application. | ✅ False |
| Which of the following is a reason to use a JavaScript framework? | ✅ To manage DOM, state, and routing efficiently |
| What is a primary benefit of component-based architecture? | ✅ Reusable UI pieces |
| In React, the syntax that allows writing HTML-like code inside JavaScript. | ✅ JSX |
| JSX in React allows developers to: | ✅ Write HTML-like syntax in JavaScript |
| JSX allows writing HTML-like syntax directly inside JavaScript. | ✅ True |
| React’s state can only be used in class components. | ✅ False |
| React concept used to store data that changes over time within a component. | ✅ State |
| React Hooks were introduced to: | ✅ Unify functional and class components |
| Hooks were introduced in React in 2018 to unify functional and class components. | ✅ True |
| React hook used to manage state in functional components. | ✅ useState |
| React hook used to handle side effects such as API calls. | ✅ useEffect |
| Which React hook is used to handle side effects like API calls? | ✅ useEffect |
| useRef in React is used to manage DOM elements or persist values across renders. | ✅ True |
| React hook that allows access to context without prop drilling. | ✅ useContext |
| React strictly requires class components for all applications. | ✅ False |
| Which framework/library is maintained by Meta/Facebook? | ✅ React |
| In Vue, reactive data means: | ✅ Data changes automatically update the UI |
| Vue feature that allows dynamic updates to the UI when data changes. | ✅ Reactivity system |
| Vue is often described as: | ✅ A progressive framework |
| The progressive framework that allows incremental adoption, created by a community. | ✅ Vue.js |
| Vue can be adopted incrementally, from a single component to a full application. | ✅ True |
| Vue file format that combines template, script, and style in one component. | |
| What does Vue Single File Component contain? | ✅ Template, script, and styles |
| Vue 3 feature that provides more flexibility for organizing component logic, similar to React Hooks. | ✅ Composition API |
| The Composition API in Vue 3 is: | ✅ Optional |
| Composables in Vue are similar to which React concept? | ✅ Custom hooks |
| Which framework uses TypeScript by default and is considered opinionated? | ✅ Angular |
| Angular is opinionated and uses TypeScript by default. | ✅ True |
| Angular feature for adding metadata to classes and properties. | ✅ Decorators |
| Angular’s dependency injection is used to: | ✅ Manage services efficiently |
| Which feature allows efficient updates without manual DOM manipulation? | ✅ Virtual DOM |
| Virtual DOM manually updates the HTML elements directly. | ✅ False |