L
U
E
T
K
E
M
J
~
C
h
a
n
g
e
~
I
s
~
G
o
o
d
🏠

160428

Young and Maps

Neil Young

Today is Thursday. On Tuesday my wife went to see Neil Young in New Braunfels, TX. It's maybe an hour or so from our house here in Austin. It was by all accounts a bucket list event. Willie Nelson showed up unexpectedly and played a couple songs with Neil. Jen got home close to 2am glowing. It was pretty awesome.

On Tuesday night I stayed home with the kids instead of going to the show. I like Neil Young, but I've never been the fan that Jen is. It's not exactly on my own bucket list. Frankie went to bed pretty early after figuring out the mothership wasn't going to hang that evening. Rem and I ordered pizza and chicken poppers and watched Minions. All in all it was a pretty all right night.

_.map();

Yesterday was Wednesday. I pulled a ticket. I needed to use lodash to sort a collection and pull the object with the highest score. A simple task for your average js dev. I tried every which way under the sun and couldn't get it sorted. Dylan spent a few minutes and slacked me the answer. Unacceptable. I had to understand this if I expect to do this work for a living. And I do.

So last night I sat down with the solution and picked it apart. After a few minutes the coin finally, FINALLY dropped. I needed to use map but for some reason what map does escaped me. Until last night. It's so simple.

  • Give map a box with two pencils and an eraser in it.

  • Tell map to reach in the box and put whatever it finds in a cup.

  • Map reaches in the box and pulls a pencil. Maps looks at my instructions and puts the pencil in a cup.

  • Map reaches in the box and pulls an eraser. Maps looks at my instructions and puts the eraser in a cup.

  • Map reaches in the box and pulls a pencil. Maps looks at my instructions and puts the pencil in a cup.

  • Map hands me a new box with three cups. Two cups have pencils in them, one has an eraser in it.