JSFiddle - React, Tailwind, and code Playground
by Kai_Draord
JavaScript
var obj = {
a: 5,
b: function(param) {
return param;
}
};
var obj = {
header: 'general',
status: function(param) {
return this.content.filter(x => x.status === 'error').length === 0 ? 'success' : 'error';
},
content: [
{
name: 'test',
status: 'success'
}, {
name: 'test2',
status: 'success'
}
]
};
console.log(obj.status());