题解 | #接口#
接口
https://www.nowcoder.com/practice/8f91b606181746558e8a398e513d1078
const _api = string => {
// 补全代码
if(string.includes('get?')){
return data
}
if(string.includes('update?')){
let str=string.split('?')[1].split('&')
for(let i=0;i<data.length;i++){
if(data[i].name===str[0].split('=')[1]){
data[i].name=str[1].split('=')[1]
}
}
return data
}
}