0π
β
In your change_name
method, you are using destructuring assignment on string. Just remove curly brackets. Change change_name({target})
to change_name(target)
.
Also you may consider to change name of target
argument to something more convenient like newName
.
Source:stackexchange.com