巧用es6解构赋值避免传入不需要的值、

    技术2024-12-30  11

    let params = { type: 'student', name: 'xiaoming', age: '9', addr: 'beijing' } let {addr,...other} = params; axios.post('/api/student',{...other})); Object.values(params); //['student', 'xiaoming', 9 ,'beijing']
    Processed: 0.017, SQL: 9