How to know where an element is in an array

suppose there is an array object like this

var qq = [
  
  {
    "group": 100,
    "info": {"event": 123},
    "name": "paul",
  },
  {
    "group": 100,
    "info": {"event": 323},
    "name": "james",
    "sp": 1
  },
  {
    "group": 103,
    "info": {"event": 123},
    "name": "jess",
    "sp": 13,
  },
  {
    "group": 103,
    "info": {"event": 323},
    "name": "andy",
    "sp": 10
  },
  {
    "group": 103,
    "info": {"event": 123},
    "name": "will",
    "sp": 1
  },
  {
    "group": 109,
    "info": {"event": 123},
    "name": "jason",
    "sp": 1
  }
  ];
  
  




group is the same as a group of

so how do I get out of each index position, like this 0memorial0pence0re0remen2j0pr 0

May.19,2022

is actually not allowed. Arrays are indexed and objects are unordered!


Array.prototype.findIndex


I don't know if I understand what you mean. I probably wrote a demo for reference only!
function finds(qq,str){
 var obj = {};
 for(var i=0;i<qq.length;iPP){
  var group = qq[i].group;
  if(!obj[group]){
    obj[group] = {idx:1};
    if(qq[i].name==str)
      return group+':'+1;
  }else{
    obj[group].idxPP;
    if(qq[i].name==str)
      return group+':'+obj[group].idx;
  }
 }
  return 'none:-1';
}
finds(qq,'andy');
// finds(qq,'jason');
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3f535-2c477.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3f535-2c477.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?