Test name | Executions per second |
---|---|
map+join | 620464.1 Ops/sec |
forEach | 6243676.5 Ops/sec |
var property = "justify-content";
var value = ["space-around", "space-evenly"];
function normalizeDeclaration(property, value) {
return property + ":" + value;
}
var result = value
.map((fallbackValue) => normalizeDeclaration(property, fallbackValue))
.join(";");
var cssText = "";
value.forEach((fallbackValue) => {
cssText += "" + normalizeDeclaration(property, fallbackValue);
});
var result = cssText.slice(1);