From a89e6229a4c88c77f9a532df8104bceba56b4c40 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sun, 10 May 2020 14:21:19 -0700 Subject: [PATCH] Rename a variable from "player_string" to "player_data" The name of "player_string" made me think this is just a string representation of a player's name. But instead, this variable is holding the JSON representation of the data block of a "player-register" event. So a name of "player_data" is much more clear. --- server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 7bb29e5..ca7b844 100644 --- a/server.js +++ b/server.js @@ -27,8 +27,8 @@ class Game { /* The syntax here is using an anonymous function to create a new object from new_player with just the subset of fields that we want. */ - const player_string = JSON.stringify((({id, name}) => ({id, name}))(new_player)); - this.broadcast_event("player-join", player_string); + const player_data = JSON.stringify((({id, name}) => ({id, name}))(new_player)); + this.broadcast_event("player-join", player_data); } remove_player(id) { -- 2.43.0