Closed DarrenSem closed 1 year ago
Instead of this:
export default function (obj) { var k, cls=''; for (k in obj) { if (obj[k]) { cls && (cls += ' '); cls += k; } } return cls; }
Use this more clear logic:
export default function (obj) { var k, cls=[]; for (k in obj) { if (obj[k]) { cls.push(k); } } return cls.join(" "); }
No thanks. Clarity is the same (subjective) but the performance of direct string building (current) is significantly faster than array building + joining
Instead of this:
Use this more clear logic: