What are the conditions to safely use the index as a key?

Posted by Andre Scott | Updated on

There are three conditions to make sure, it is safe use the index as a key.

  1. The list and items are static– they are not computed and do not change
  2. The items in the list have no ids
  3. The list is never reordered or filtered.

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers