const categories = [];
for (let i = 0; i < this.keyword.datas.length; iPP) {
if (i === 0) {
categories.push({
name: this.keyword.datas[0].type,
});
}
for (let j = 0; categories[0] !== undefined && j < categories.length; jPP) {
if (categories[j].name === this.keyword.datas[i].type) {
//
break;
}
if (j === categories.length - 1) {
categories.push({
name: this.keyword.datas[i].type,
});
}
}
}
what does this code mean? Those who understand can help explain it. Now I am going to rewrite it, but I can only understand half of it
.