DeepFrontend
Learning Paths
Practice
System Design & DS
Design Studio
Data Structures Curriculum
Real-World Case Studies
Careers
Job Board
Resume Builder
Blog
Sign in
Search
⌘K
Go Pro
Loading compiler resources...
AI for Frontend Developers Quiz Practice
Active Recall Drill Session
← Exit Session
Question 1 of 1
medium
AI for Frontend Developers
In the regenerateLastResponse function, what condition determines whether a turn should be dropped from the end of the messages array?
A
Always drop the last message regardless of role
B
Only drop it if the last message's role is 'assistant' — it represents the previous response being regenerated away
C
Drop the first message in the array
D
Never drop anything; append a new empty turn instead
Check Answer