✅ – _mercury – 21-51 Aug 29

why parseInt does not work here
groups.forEach((group) => {
return Object.keys(group).forEach((key) => {
if (key === 'attributes_count' || key === 'templates_count') {
parseInt(group[key]);
}
if (!group[key]) {
delete group[key];
}
});
});
groups.forEach((group) => {
return Object.keys(group).forEach((key) => {
if (key === 'attributes_count' || key === 'templates_count') {
parseInt(group[key]);
}
if (!group[key]) {
delete group[key];
}
});
});
M
_mercury598d ago
UU
Unknown User598d ago
M
_mercury598d ago
so?
UU
Unknown User598d ago
M
_mercury598d ago
yes the second if works why ?
UU
Unknown User598d ago
M
_mercury598d ago
UU
Unknown User598d ago
M
_mercury598d ago
groups.forEach((group) => {
return Object.keys(group).forEach((key) => {
if (key === 'attributes_count' || key === 'templates_count') {
group[key] = parseInt(group[key]);
}
if (!group[key]) {
delete group[key];
}
});
});
groups.forEach((group) => {
return Object.keys(group).forEach((key) => {
if (key === 'attributes_count' || key === 'templates_count') {
group[key] = parseInt(group[key]);
}
if (!group[key]) {
delete group[key];
}
});
});
attributes_count + trmplates_count disappear
UU
Unknown User598d ago
M
_mercury598d ago
Ok i got that , thx .. but keys disppaear
UU
Unknown User598d ago
M
_mercury598d ago
group[key] = parseInt(group[key]) || 0; same issue
UU
Unknown User598d ago
M
_mercury598d ago
Aha
UU
Unknown User598d ago
M
_mercury598d ago
ok thanx
groups.forEach((group) => {
return Object.keys(group).forEach((key) => {
if (!group[key]) {
delete group[key];
}
if (key === 'attributes_count' || key === 'templates_count') {
group[key] = parseInt(group[key]) || 0;
}
});
});
groups.forEach((group) => {
return Object.keys(group).forEach((key) => {
if (!group[key]) {
delete group[key];
}
if (key === 'attributes_count' || key === 'templates_count') {
group[key] = parseInt(group[key]) || 0;
}
});
});
UU
Unknown User598d ago
M
_mercury598d ago
I raised the delete up and now it works thanx for smashing that
UU
Unknown User597d ago