I am learning vue and I came across this weird syntax in defining a function, I am curious what it is called and where i can learn more about it
register({commit}, credentials){
}
Why are there brackets around commit
? Shouldn't it just be simple:
register(commit, credentials){
}
What's the purpose of placing brackets around commit
variable?