How to throw an error using try catch statement?

后端 未结 1 1148
耶瑟儿~
耶瑟儿~ 2021-01-29 14:50
//Utility
  const readUserUtility = (id_a)=>{
    const currentstore = store.getState();
    const returnedArray = currentstore.users.filter((user_object)=>{
              


        
相关标签:
1条回答
  • 2021-01-29 15:40

    You have to create a new Error object and pass that. Below works for me:

    throw new Error("item not found");

    0 讨论(0)
提交回复
热议问题