Open payne-chris-r opened 7 years ago
I support doing away with one letter variable names in almost every case.
On Mon, Dec 12, 2016, 1:51 PM Chris R. Payne notifications@github.com wrote:
Hashes don't exist in javascript.
const mapPerson = function (h) { let newPerson = { name: {} }; Object.keys(h).forEach(function() { newPerson.name.given = h.given_name; newPerson.name.surname = h.surname; newPerson.dob = h.dob; newPerson.gender = h.gender; newPerson.height = h.height; newPerson.weight = h.weight; }); return newPerson; };
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ga-wdi-boston/mongoose-crud/issues/40, or mute the thread https://github.com/notifications/unsubscribe-auth/ANRw2OTqtc6PIACYpgLllA6lt558lzyeks5rHZergaJpZM4LK5BJ .
Naming things is hard. Is hash
a better name than h
?
Hashes do exist in JavaScript. Every object is a hash.
Also, see #34
They do?! Objects are considered hashes too? I no likey! hash
just feels very ruby
y. That's probably my lack of experience showing... I just think there are better names (if we decide this code is worth keeping). dict
? person
? It is called mapPerson
...
I think hash is better than h.
On Tue, Dec 13, 2016, 8:37 PM Chris R. Payne notifications@github.com wrote:
Reopened #40 https://github.com/ga-wdi-boston/mongoose-crud/issues/40.
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/ga-wdi-boston/mongoose-crud/issues/40#event-892975287, or mute the thread https://github.com/notifications/unsubscribe-auth/ANRw2PivXOLDvp9EVxd1dnj2XNcex_0Sks5rH0hMgaJpZM4LK5BJ .
But what about #34?
The name of the variable is the least of the issues.
Hashes don't exist in javascript.