Here is the code
var obj = {!!json_encode($assets_name)!!}
Object.keys(obj).forEach(function(key) {
console.log(key, obj[key]);
});
//Actual Result
// Trying to Get
Is there a way to get this result?
Keyboard,Mouse,Spoons,Paper,Keyboard
Here is the code
var obj = {!!json_encode($assets_name)!!}
Object.keys(obj).forEach(function(key) {
console.log(key, obj[key]);
});
//Actual Result
// Trying to Get
Is there a way to get this result?
Keyboard,Mouse,Spoons,Paper,Keyboard
Instead of Object.keys
use Object.values which will return a array of the value. Then you can use join(',')
which will return a string joined by comma