Q. What is the use of the `trackBy` function in *ngFor?

  • (A) To filter the items
  • (B) To sort the items
  • (C) To improve performance by tracking item identity
  • (D) To convert item to string
πŸ’¬ Discuss
βœ… Correct Answer: (C) To improve performance by tracking item identity
Explanation: trackBy helps Angular track which items have changed, improving rendering performance.
Explanation by: Mr. Dubey
trackBy helps Angular track which items have changed, improving rendering performance.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
85
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
97%
Success Rate