How to fight tons of unresolved variables warning in WebStorm?

前端 未结 6 1814
陌清茗
陌清茗 2020-12-04 09:19

I have a function that takes data from server:

function getData(data){
    console.log(data.someVar);
}

WebStorm says that someVar

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-04 10:12

    Destructuring use, Luke.

    function getData(data){
        const {member} = data;
        console.log(member);
    }
    

提交回复
热议问题