1👍
It stops at the first argument because that’s the first argument that is truthy, so the other arguments are ignored. If you attempted to call the function with undefined
first (falsy value), it would skip that one and send the second argument.
One way to accomplish your intended goal would be to send all possible arguments as an array of arguments and use Array.includes() in your function:
getNumber() {
return this.getErrorByMemberId(['Cvr', 'B2Bvr', undefined]);
},
const getByTitle = (memberTitleArray) => {
return state.errors.find(e => memberTitleArray.includes(e.meta.memberTitle))
?.content.error.title;
}
- [Vuejs]-Fixing three aesthetic issues regarding an html input, select, and button
- [Vuejs]-Email only authentication with Vue.js and Vuex on Firebase
Source:stackexchange.com