Message from JavaScript discussions

April 2019

— You might want to restrict the objects though


Because if you pass an object containing a property the class doesn't know about, that will still be included

— You can use the pluck utility for that :)

— No, wait, you need pick

— Lol

— const pick = keys => obj =>
.reduce((acc, [ key, value ]) =>
? ({ ...acc, [key]: value })
: acc, {});

Message permanent page

— const pick = keys => obj =>
keys.reduce((acc, key) =>
key in obj
? ({ ...acc, [key]: obj[key] })
: acc, {});

Message permanent page

— Cleaner version

— Just finished testing my random sim creator

— It's working magic

— I feel I just need to continue adding to the game not necessarily cleaning, I'm a noob so there will be always something to improve but what I want to achieve is to make it work

Message permanent page

— And then I go back to clean or rewrite it entirely