currcertFun(){
var arr = [1, 3, 5]; // 需要匹配的数字数组
var objArr = [
{ id: 1, chinese: '汉字1' },
{ id: 2, chinese: '汉字2' },
{ id: 3, chinese: '汉字3' },
{ id: 4, chinese: '汉字4' },
{ id: 5, chinese: '汉字5' } ];
var result = []; // 存储匹配结果的数组
arr .forEach(element => {
const matchedobj = this.objArr .find(item => item.id== element);
if (matchedobj) {
result.push(matchedobj.chinese)
};
})
return result.tostring();
}