JSFiddle - React, Tailwind, and code Playground
JavaScript
var item = {};
item.attribute = {
agility:100,
stamina:200,
dodge:300
};
var text = "";
for(var property in item.attribute){
if(item.attribute.hasOwnProperty(property)){
if(text.length > 0) text += " ";
text += "+ " + property.charAt(0).toUpperCase() + property.substr(1);
}
}
console.log(text);