CHATGPT Flashcards
1
Q
What is a middleware in web development?
A
Middleware is code that runs between the request and the controller. It can modify the request or response.
2
Q
What is the purpose of a foreign key in a database?
A
The main purpose of a foreign key is to link records between two tables and keep data consistent.
3
Q
What is the difference between synchronous and asynchronous code?
A
Synchronous code runs step by step, one after another.
Asynchronous code can continue running without waiting for a task to finish, using things like promises or callbacks.