Skip to content

Instantly share code, notes, and snippets.

@susiirwin
Last active November 21, 2016 19:14
Show Gist options
  • Save susiirwin/dda918b7b50485e83322310392847837 to your computer and use it in GitHub Desktop.
Save susiirwin/dda918b7b50485e83322310392847837 to your computer and use it in GitHub Desktop.

####Leap - first exercise

My code here

  • Responder #1 (here) - This is really similar to mine - our order is a bit different.

  • Responder #2 (here) - Another single line, which i like, but he used === instead of == like i did. I made the choice to use == since I wasn't concerned with type - just value.

  • Responder #3 (here) - This one is broken out a bit more - it sort of looks like my first iteration (before I submitted). I think this is readable for sure.

  • Responder #4 (here) - This submission is fairly complicated and not super readable, to me at least. I see that this person created variables to use in the returns, but I am not entirely sure why. This doesn't feel efficient but it is hard for me to know since I am brand new to this haha.

  • Responder #5 (here) - A very readbale solution, though I tend to take my comments out of my code once I am done with them. This looks similar to my first pass as well before I refactored to combine. It makes a ton of sense, and is super clean.

####Bob My code here ( I GOT A LIKE! )

I did this one because it said it was based on Deaf Grandma and that one was a TON of fun in Ruby. I had to google a lot on the empty space one.

  • Responder #1 here - Simlar to me, she kept her code in the if/else if/else format with no external functions. She uses a lot of regex too. That format is becoming more familiar to me, but i still have to look it up everytime.

  • Responder #2 here - i like that this one uses the .trim method on the input - i read about that in my JavaScript & jQuery book, but wasn't getting it to function the way I wanted it to. I am going to keep trying this one though, because i like this WAY better than the rege which feels sort of hacky to me.

  • Responder #3 here - I have seen a few responses with using let but have not tried it. i think this is a newer version of JS maybe? Could be version 6, bit quite sure. I read about it in a chapter yesterday. Feels like let is like a setup for the function: "let it be this until it is not."

  • Responder #4 here - This solution reminds me more of mine. I really like the 2nd else if statement that uses .trim and .length to handle the empty string.

  • Responder #5 here - This solution is one of the more complicated that I read through. He uses case statements to go through the logic - seems a bit heavy, but I am not sure. I found this one challenging to read through but also extremely intriguing.

####Phone-Number My code here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment