Be .select-ive When Choosing Your Enumerables

Once upon a time, a landscape designer turned stay-at-home parent decided to become a software engineer. It may sound far-fetched — to picture such a drastic shift in careers — but the three are actually very similar. Software engineering is a form of design, and the journey to become a programmer via bootcamp is fraught with perils that have the same panicky, fly-by-the-seat of your pants feel as does raising a child. In the same way that you need certain tools and skills to create a functional landscape, or to help navigate a tantrum while picking out an outfit for your 3 year old child, you must also choose the right tools for creating a functional program. Enter, Ruby enumerables.

Image for post
Image for post
Finding the right enumerable can be frightening!
Image for post
Image for post
Let’s unravel this enumerable mystery!
Image for post
Image for post
To understand how enumerables work, you just need to experiment with the code a bit!
Image for post
Image for post
Selecting strings that begin with “S” in an array with .select
Image for post
Image for post
Excluding strings that start with “S” in an array with .reject
Image for post
Image for post
Capitalizing strings in an array with .map
Image for post
Image for post
It’s not witchcraft! Start using .select and .map — you’ll see how easy it can be!
Image for post
Image for post
incorrect use of .map
Image for post
Image for post
incorrect use of .select
Image for post
Image for post
.select and .map unmasked!

Software Engineer // JavaScript | React Hooks | Ruby on Rails

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store