In Vue.js: How do I convert an array to an object? I wanted to get name value only "Willy" from the array.
Array data from LocalStorage:
[{"id":"56b5","name":"Willy","email":"willy@test","password":"1234"}]
I wanted it to be converted like this :
{"id":"56b5","name":"Willy","email":"willy@test","password":"1234"}
Please help.
to further use :
let user = localStorage.getItem('user-info');
this.name = JSON.parse(user).name;
and the result should be "Willy".