Skip to content

Instantly share code, notes, and snippets.

@ShannonPaige
Last active March 26, 2016 18:15
Show Gist options
  • Save ShannonPaige/d11b7bf62c8a2bf40f3b to your computer and use it in GitHub Desktop.
Save ShannonPaige/d11b7bf62c8a2bf40f3b to your computer and use it in GitHub Desktop.
javascript_exercism_review.md

##Leap My code: here

  • Responder #1 (here) - This user begins by doing an "if" check on the century condition, but then returns the result of a conditional check, on the year%4. It's interesting, but the inconsistency of the two approaches smells to me. I would have done an if statement for both or return the result of the conditional check for both -- not one of each.
  • Responder #2 (here) - This user has a solution almost exactly like mine, but they wrap the entire method in "if(typeof this.input === 'number')" -- and I don't know why...
  • Responder #3 (here) - Another user who has an answer really close to mine, but with small differences I don't necessarily understand. They "use strict" and their isLeap module isn't a prototype.
  • Responder #4 (here) - Jhun's response has the same logic as mine, but he returns the result of the conditional instead of setting up and if/else statement. I like his better.
  • Responder #5 (here) - WTF is this guy doing!?!?! It's crazy!!!! Import R from "ramda"??, crazy underscore notation for modulo...insane or brilliant, I dunno, but I wanna make an ascii graphic for the top of all my code now.

##Hamming My code: here

  • Responder #1 (here) - Almost the exact same as mine, except he checked letters using array notation, which I used originally but I forgot to put my if statement in parenthesis, so I got an unidentified syntax error and thought it was the array notation, so I researched another way to reference the letters.
  • Responder #2 (here) - Same as responder #1
  • Responder #3 (here) - Same as responders 1 and 2 - not a lot of variety on this one.
  • Responder #4 (here) - And still the same
  • Responder #5 (here) - And the same.

##Rna Transcription My code: here

  • Responder #1 (here) - Exact same as mine
  • Responder #2 (here) - Used map to map from DNA to RNA. Called another function from within his toRna method, which I tried to do in Hamming but couldn't get to work, so was interesting to see.
  • Responder #3 (here) - A combo of mine and #2, he called another function from within toRna, but it wasn't map. Overly complicated.
  • Responder #4 (here) - Used the for loop to call a 'complement' function, instead of using switch/case
  • Responder #5 (here) - Used a replace function to update the RNA strand.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment