Talking about the method of high efficiency of jquery splicing string

  • 2021-07-22 08:53:51
  • OfStack

Examples are as follows:


var roleidArray = new Array("");
for(i = 0; i < rightRows.length; i++) {
  roleidArray.push(rightRows[i].id);
}
roleidArray = roleidArray.join(",").substring(1);

The code is simple, so I won't comment


Related articles: