Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Question: What is the purpose of trackBy in ngFor?
Answer: The trackBy function is used in ngFor to improve the performance of rendering by helping Angular identify which items have changed, been added, or been removed in a list.

Example:

*ngFor='let item of items; trackBy: trackByFunction'
Is it helpful? Yes No

Most helpful rated by users:

©2026 WithoutBook