Conditionally Spread Array Javascript Append Html