Console.log is my friend (yours, too)

I don’t get to use a lot of JavaScript at this point in my new job, so to keep up on my JS skillz I spend some of my weekend time practicing old things or learning new things. Right now I’m learning Node. And while reading some code for a basic Express server, I was reminded of the lovely thing that is console.log.

Here’s the code:

var express = require('express')
var app = express()

var jsonData = {count: 12, message: 'hey'}

app.get('/', function(req, res){
  res.sendFile(__dirname + '/index.html', function(err) {
    if (err) {

app.get('/data', function(req, res) {

var port = 3000
app.listen(port, function(){
  console.log('listening on http://localhost:', port)

I can see the code is pulling in Express, that it’s declaring a jsonData variable and assigning an object to it, that the get method will call one of two functions depending on the path that’s being requested, and that the listen method will show me what’s happening on my localhost:3000. And I can see those two get functions are going to use req and res, and I can see what happens with res…but what about req? I figure it’s the request coming in, but I have this need to know what all parts of all things look like, so how do I find out? Put a console.log in those functions, of course! It’s about a gazillion lines of data so I won’t repost it all here but at the very bottom, I see something like this for the first get function when I ask for the root path(‘/’):

route: Route { path: '/', stack: [ [Object] ], methods: { get: true } } }

And something like this for the second get function when I ask for the data path (‘/data’):

route: Route { path: '/data', stack: [ [Object] ], methods: { get: true } } }

Doing things like this helps the code make more sense in my brain. While I understood that the functions were taking in requests and returning responses, now I can see what the requests actually look like and I can see how the functions are seeing the path. Yay!

Flex-basis, flex-grow, & flex-shrink

Flex-basis, flex-grow, and flex-shrink are three Flexbox properties that can make things easier when dealing with responsive design. So what’s the difference between them? Let’s take a look at some code and find out!

Flex-basis is how much space we want our element taking up in an ideal world, before we start addressing extra space or less space. So in this instance, we want each of these divs to be 100px wide.

.div1 {
  flex-basis: 100px;

.div2 {
  flex-basis: 100px;

Now, when we’re viewing these two divs in any browser wider than 200px, there’s going to be some leftover whitespace. Flex-grow helps us decide how we want to divvy up any extra whitespace between our elements. So, as whitespace expands, div1 will take up twice as much of it as div2:

.div1 {
  flex-basis: 100px;
  flex-grow: 2;

.div2 {
  flex-basis: 100px;
  flex-grow: 1;

Flex-shrink helps us decide how we want our elements to behave as space decreases. In this case, we want div2 to shrink twice as much as div1:

.div1 {
  flex-basis: 100px;
  flex-grow: 2;
  flex-shrink: 1;

.div2 {
  flex-basis: 100px;
  flex-grow: 1;
  flex-shrink: 2;

To make it much more concise, we can re-write our code like this:

.div1 {
  flex: 2 1 100px;

.div2 {
  flex: 1 2 100px;

I hope that helps make sense of these three properties. If you want to learn more about Flexbox, you can’t go wrong with Wes Bos’ free series.

On object manipulation in JavaScript

Honesty is important to me, even when it means coming clean about things I struggle with. Today, I confess that I struggle with comprehending object manipulation in JavaScript. Earlier this morning I was pairing with a friend on some katas in Code Wars, and I was struggling to understand what was happening with this code:

let staff = {
  tim: 'finance',
  jim: 'accounts',
  randy: 'canteen'

function boredom(staff) {
  var map = {
    accounts: 1,
    finance: 2,
    canteen: 10

  var score = Object.keys(staff).reduce((a, b) => {
    return a + map[staff[b]]
  }, 0)

  return score <= 13 ? 'kill me now' : 'party time!!'

As you can see, boredom is taking in the staff object, where it wants to match up the staff values with the corresponding numbers in the map object, then tally the numbers to produce a score and return that score’s relevant string. So theoretically I understood all that, but not this specific part:


My brain was reading it like this…


…which is sort of right, but also why I was getting confused.
I mean, map and staff are two separate objects, not connected in any way, so how is that working? Let’s walk through it! And by let’s I mean me, so I can solidify my understanding 🙂

Alright, so the first time through, a is 0 and b is ‘tim.’ Which means map[staff[b]] is basically map['tim']. And what’s Tim’s value? It’s finance. Since Tim’s value is ‘finance,’ map['tim'] is basically And what is That’s right, it’s 2! So the first time through, 2 gets added to 0, and on the next time through 2 becomes a, and b is now ‘jim,’ and on and on until the numbers are reduced down and boredom spits out how you feel about your office’s fun level.

Check out the reduce method on MDN.

Find out more about objects in Eloquent JavaScript.

And don’t forget, you can walk through code step-by-step on this site.

That time my blog got hacked (or did it?)

You may notice there’s a bit of a lapse in time between this post and the one before. You may be wondering what happened to weeks six through twelve. Well, let me tell you a little story.

Bootcamp got crazy about halfway through and I could not keep up on writing posts. Every week, I would take notes and compose a quick draft, but could never find the time (or leftover brain power) to polish the piece.

Fast forward to the end of school (middle of December). We were given three weeks to create our final project and there I was, four days before demo day and thinking, “I finished early! Yay! Now I have time to get my blog up to date!” I try to log in and can’t. I quickly figure out my site has been blacklisted for phishing, which I find hilarious because I don’t have users on my blog, I don’t allow comments, etc. – it’s mostly just a place for me to lay down my thoughts and show people that I can indeed put sentences together. So, good job phishers! You picked a winner! I find out it takes about $200 to get a site ‘cleaned,’ which I can’t justify spending. I turn to the AMAZING Utah JavaScript community for input, and a complete stranger offers to log in to my site and clean it for free. Thing is, he can’t find any malicious code at all once he gets in there. So we ask Google to review it, and they say, “Nah, it’s still blacklisted.”

Meanwhile, school is over, then the holidays come and go, then job hunting begins in earnest. Why yes, I am still paying monthly hosting and domain fees, because annual contracts, don’t ya know! I spend a lot of my time coding and decide that since I can’t have the site cleaned, maybe I’ll just copy what I can to a web app I built myself. So just a few days ago I pull up my site to find a posted date, and what do you know, it’s not blacklisted anymore!! And there they all are, my 18 or so drafts waiting to be finished and published. Which maybe I’ll do someday, after I have a job 🙂

Thoughts from week 5 of coding bootcamp

Early in week 4 I’d wanted to quit for at least the 10th time; things got better after that. I don’t think it was because the material became easier or my brain suddenly understood everything – rather, I finally realized I am doing all I am capable of and there’s little sense in beating myself up over incomplete or not-up-to-my-standards homework. There is literally nothing more I can do. I barely see my family, my TV time is limited to Sunday evening’s Westworld, I haven’t gone to a movie or out with friends in who knows how long, I’m not doing the cleaning or the laundry or the cooking or the grocery shopping – all I am doing is bootcamp stuff!

And while my brain isn’t necessarily understanding things completely, it is beginning to grasp how all the pieces fit together and that’s making me feel a little less like drowning and more like (mostly) keeping my head (halfway) out of the water. I am still struggling with the execution of JavaScript itself, but conceptually I’m having no difficulties comprehending things like this, objects, constructors, or prototypes. We’re also dealing with Webpack this week and that’s been fun and interesting. If given the chance, I will still spend 10 hours of an assignment on the logic itself and maybe a half hour on styling and I don’t expect that to change anytime soon. JavaScript is just too interesting 🙂

Let’s learn about objects and this

No really, let’s. Because I’ve learned this already, but I need all the reviewing I can get. This should take 6-8 hours.

First, watch these videos by one of my very favorite JS resources, Mattias P. Johansson. (And later on, find time to watch all his other videos – he’s highly entertaining, very human, and also super nice on social media.) No need to code along.

Then read chapters 1 and 2 of this book by another one of my favorites, Kyle Simpson. You may, like me, feel both dumber and smarter after reading Kyle’s material, but that’s okay – he knows his stuff and it’ll be worth it. I like to code along with the examples Kyle provides, but you don’t have to.

Now, code along with Mary while she makes a fun little game. She moves fast and you may have to stop the video every few minutes to catch up. After you’ve got all your code written and working, watch the video again while adding comments to your code about what every single thing is and what it’s doing. You’ll learn more in this second run-through than you could catch in the first, trust me.

There, now you’re an expert! Okay, not really – but you learned some stuff, right? BOOM.

Thoughts from week 4 of coding bootcamp

Oof. Week 4 of bootcamp was tough. Tuesday morning found me feeling very down on the way to school. I wanted to quit. The day before, we’d been given an assignment using APIs, and I couldn’t get one small part of mine figured out. The issue wasn’t even getting the Ajax call to work – it was getting down into the right level of each object as I pushed them to the DOM in a table. This is the story of my JavaScripting life: knowing conceptually what I need to do and knowing how to do it, but missing one tiny piece of the puzzle. Terribly frustrating! But by Tuesday afternoon I’d solved my problem and was feeling good about the world. This lasted until Saturday, when I went to my third meetup of the week, and it all came crashing down again.

I’d wanted to quit in week 3, too. Actually, if I don’t want to quit at least 3 times in a week, I consider it a good week. Before bootcamp started, I had naive worries about the schedule, my class, the location. I never suspected the real battle would be convincing myself to keep going back. Every. Single. Day. Don’t get me wrong – I absolutely adore my classmates, our instructor, the campus director…everything about The Iron Yard, really – but it is hard to get a third of the way into this and still feel like I know basically nothing. Every day I feel like I am repeatedly throwing myself against a brick wall, with naught to show for it but a mutilated sense of self-worth.

(Pretty dramatic, right? I know.)

I’m trying to trust that this isn’t reality. That my brain is absorbing the things it needs to, and it’s all going to come together eventually. I asked a local Iron Yard alumni if she ever stopped feeling like she didn’t know anything, and she said it was in week 11 of 12. 7 weeks away. If you find yourself experiencing this during coding bootcamp, you’ll want to know how to hang on until then. Here’s what’s working for me so far.

Trust your instructor. So many times I’ve felt behind and didn’t want to do the morning exercises from our instructor; I’d want to read up on things to fill in the holes in my learning. But two days later, I would find myself relying on what I had learned during the morning exercises. Even when it’s frustrating, go with it!

Look back over your notes from previous weeks of class. Do you need those notes anymore? No, because you know that stuff by heart now. Tell yourself that in the future you won’t need the notes you’re relying on today. You will make progress!

Immerse yourself! You might as well, right? Read a JS book on the train, listen to a JS podcast on the walk, read JS blog posts in the morning with your coffee. Right before I go to bed, I like to give my brain one last concept to play with while I’m sleeping. The JS dreams are getting exhausting, it’s true – but if it helps me learn, I’m willing to deal with it.

Go to meetups for rejuvenation and inspiration!! I’ve mentioned that I’m terrified of meetups, but I go anyway – because no matter how bad my day has been, I always come away feeling amazing. Even the meetup on Saturday, which I felt woefully unprepared for and almost walked out of halfway through, reminded me that hey, I may not know anything yet, but JavaScript is still completely fascinating to me and I am on the right path.

It is so much info. Your brain is processing it whether you realize it or not. Hang in there. You can do it!

JavaScript thoroughly. JavaScript and repeat.

An image of a JavaScript book by Kyle Simpson.
A fantastic book series I read on the train to and from school every day.

This won’t be a ‘thoughts from week 3 of bootcamp’ post, because I have no thoughts left in my head.

There is only JavaScript.

If the thing I’m trying to think about is not JavaScript, my brain is just not interested, thank you very much.

The hour-long journey to and from campus every day has become a blur. Some days I cannot remember if I walked the final two miles or took Trax. Spans of time the length of entire workdays pass without me noticing. A couple of nights ago Dustin came home from work to find me sitting in the dark with my MacBook, not having bothered to turn a single light on during the past 5 hours because hey, not JavaScript. I misplaced my phone four times between heading upstairs for bed and actually getting into bed. One evening I was water-flossing while mulling over my code when my brain developed a solution, and I walked straight to my computer to write the code, accidentally leaving the WaterPik on – full and running.

My brain is only interested in JavaScript even when it’s supposed to be sleeping. I wake up multiple times a night to find it tossing around coding assignments in an infinite loop. I imagine what it must be like for my loved ones right now: They talk to a blank-faced robot about their daily struggles, and when they’re finished the robot comes to life and responds with a bunch of jibberish about callbacks, promises, prototypes, and inheritance. Frequently the robot has a breakdown and cries just like a human would, but don’t be fooled – it’s only crying about JavaScript.

It’s not like I want my brain to be this way. I appreciate its preoccupation with JavaScript, because my goodness, it is fascinating stuff – but damn, a girl would like a break! 10 hours of JS a day should be enough, right? I’d like to have oysters and champagne with Deez without thinking about let, const, and var. I’d like to shower without reminding myself, “Now I’m shampooing my hair, now I’m conditioning my JavaScript…” and 5 minutes later having to repeat the process. I would love to be able to answer questions like, “Do you want roasted peppers on your salad?” or, “Do you want a beer?” with a word besides, “What?”

I really can’t expect anything else of my brain right now with all that’s being thrown at it. The first two weeks of bootcamp were pretty chill compared to the acceleration that’s happening now, and I know our instructor is still holding back. How do people doing this without a support network survive? I’m trying to imagine not having Deezus doing the grocery shopping, cooking, cleaning, laundry, and offspring-wrangling while I’m in bootcamp, and I can’t even. I did all that stuff myself while in college and working full-time, which was incredibly difficult – and this is waaaaay harder than college! If you are a bootcamp grad who made it through without any help, @ me, because I need you to teach me things!

In the meantime, I’m going to go get some JavaScript.

Specks of victory

They warn you to be okay with being uncomfortable. You read a hundred blog posts that say the same. YOU RETWEET QUOTES ABOUT IT. You think to yourself, “It’s part of why I’m doing this, because I was too comfortable in my previous life – I was getting too stagnant.” But no…you have no idea.

No idea what it will be like to go from having every answer you need, from being queen of your domain, from feeling good about yourself because in general you’re doing shit right, to experiencing day after day of failure, to being thrown so off-balance by the paradigm shift that it even starts affecting the rightness of stuff you do in your home life, to feeling afraid to do anything at all because recent experience has taught you the probability of getting it right is NOT GOOD.

And you thought you had this discomfort thing down because hey, you’d already survived letting down the ones who count on you by quitting your cushy job; and hey, you’d already gone against everything you believed about money in order to take a giant risk with basically your entire savings account; and hey, you’d already spent countless hours over the last 16 weeks alone, with yourself, dealing with the crazy beasts inside your head. But no…you had no idea.

No idea that this discomfort would tear you down, but it doesn’t build you back up, no – it leaves you to fend for yourself, leaves you to sift through the rubble looking for the tiniest speck of ANYTHING you can call a victory. Last week you were aware that you had strengths and weaknesses. This week you only have weaknesses and a keen desperation to not feel like a fool. So you search, and you search, and eventually your brain comes up with:

Weakness: Teaching others.
Speck of victory: Within that inability to guide/teach someone else, there lies a window for them to find their own way. And I do have the ability to support people as they discover their own best way of doing things, and encourage them, and help them feel safe making mistakes.

Weakness: JavaScript solutions don’t come naturally to me.
Speck of victory: My code is organized, detailed, and at least I do understand what it’s doing.

Weakness: Basically terrified of meetups.
Speck of victory: I still make myself go.

And your brain has to be satisfied with these three itty bitty victories it found, because you now have 5 hours to sleep before getting up and throwing yourself at failure again. And you’re not quite sure if the rest of your life will be this way, but it’s the decision you made, so ¯\_(ツ)_/¯

Thoughts from week 2 of coding bootcamp


1) We opened with some Markdown exercises. I can see its usefulness when blogging about things in specific languages. Despair as I think, “Will I ever get to that point?!”

2) Iron Yard students are expected to teach crash courses to the public, and take turns hosting the JS Learners group. This is awesome but terrifying. Who wants to be the teacher/host unable to answer questions, so students feel they wasted their time?

3) We reviewed our weekend projects in class (here is my GitHub page for it) and discussed what makes good visual design. It was actually pretty fascinating, which surprised me. Imagine knowing all the things that the eye expects and then how to make those things happen!

4) The global day of code is coming up and I want to participate, but I’d hate to get partnered with someone who has to carry me and do all the work. I am not a person who rides on others’ coattails and doesn’t contribute!


1) Okay, so CSS and all its inheritances is pretty dang cool. I can imagine it’s hard to be really good at CSS, which is funny since so many people dismiss it as easy, or as ‘not programming.’ But this person could be hella important on a team. I kind of want to go do all the learning on CSS now, but no time for that yet – JavaScript starts today.

2) We were given 5 JS problems as homework. I had a rubber duck moment with one – I was venting to my husband about how I couldn’t figure out how to do the Rovarspraket and as I was explaining it, it dawned on me exactly how to do it. Rubber ducking is not limited to tech of course – he responded that earlier that day, as soon as he started explaining a new process to his team, he realized he’d made a mistake and what it was.


1) Playing with JavaScript is fun, even if I’m writing the smallest, simplest function. So much more fun than HTML/CSS! (Sorry, my first week friends – you’re still cool, but…) I was familiar with the built-in methods for arrays but I had no idea strings had the same sort of thing and this just made my day. Spent a half hour reading up on regexes and am excited for when we are allowed to use those.

2) My poor spouse. Probably any poor significant other of a bootcamp student. He has to deal with me texting him little snippets of code I write, or showing him what I did at the end of the day because I’m so excited. He’s willing to listen even if he doesn’t understand, of course – because he’s the best.


1) JavaScript comes easy to me, but it doesn’t come naturally. Does that make sense? Once I’m shown or figure out how to do something, I get it pretty quickly, but as for being able to pull out of my head a hundred different solutions to whatever is presented to me – nah, that’s not me. Not yet anyway. Accounting was the same way at first, but I did get to that ‘natural’ point eventually (after about 8 years, haha).

2) We did some more mob programming today. I thought I would dislike being the head navigator but I ended up enjoying myself immensely. I’m surrounded by smart people; when I need input or ideas everyone is ready to help out. I feel super lucky to be in this specific cohort.


1) Presentation day! Turns out presentations aren’t all that bad once I’ve had time for the slightest bit of preparation. Inspired by this blog post by Rob Martin, I presented on collaboration in tech, how mob programming is one of the ways we collaborate, and how we can be better collaborators. My five minutes was up way too soon.

2) For weekend homework we were given a project quite beyond what we’ve learned in class, but that’s okay – our instructor has given us the resources and techniques to find answers to our questions, so I’m still excited to give the assignment a try!

Also published on Medium.