js determines if there is a simple instance of of that does not need a loop for the array key

  • 2021-07-07 06:28:19
  • OfStack

Examples are as follows:


var aaa = {
  "0":"a",
  "1":"b",
  "2":"c",
  "aa":"d",
  "4":"e"
};

alert(aaa .hasOwnProperty(4));//true 

Related articles: