]> git.cworth.org Git - lmno.games/blobdiff - empathy/empathy.jsx
Avoid unnecessary use of fill(null)
[lmno.games] / empathy / empathy.jsx
index 54d6c2660975aac30c9376ba05cff1c4feef3048..cd5f3423d845f731e309e5521287a58e68f93c77 100644 (file)
@@ -127,10 +127,12 @@ const PlayerInfo = React.memo(props => {
     <div className="player-info">
       <span className="players-header">Players: </span>
       {props.player.name}
+      {props.player.score > 0 ? ` (${props.player.score})` : ""}
       {props.other_players.map(other => (
         <span key={other.id}>
           {", "}
           {other.name}
+          {other.score > 0 ? ` (${other.score})` : ""}
         </span>
       ))}
     </div>
@@ -366,7 +368,7 @@ class ActivePrompt extends React.PureComponent {
         </p>
         <h2>{this.props.prompt.prompt}</h2>
         <form onSubmit={this.handle_submit}>
-          {Array(this.props.prompt.items).fill(null).map((whocares,i) => {
+          {[...Array(this.props.prompt.items)].map((whocares,i) => {
             return (
               <div
                 key={i}