- (code) This submission did not use the modulus operator, but instead checked if the result of dividing by a number was an integer.
- (code) I liked this one because he created a method for checking if the year was divisible by a given number, it cleans the code up a lot.
- (code) This solution doesn't take advantage of the fact that the bunch of logic will already return a boolean, no need to explicitly return true or false.
- (code) Extremely similar to my solution, except that they are using
==instead of the===, which makes the code more readable, but might not be a good idea. I ran across this resource and it states: "If either value in a comparison could be of these specific values (0,"", or[]-- empty array), avoid==and use===." - (code) This guy made three separate functions for if a given number was divisible by 4, 100, and 400. I like the earlier solution mentioned above of just having one function for this. He imported a package called
ramdaand used.moduloinstead of the%operator, which does make it more readable.
- (code) I liked this submission, it's easier to read than mine. I like that he just uses a for loop and goes through each index of the string, whereas I split the string into an array (which took more steps).
- (code) Comparing this one to the previous one, I don't like it, her
forloop is starting from the end of the strand and working backward, it just adds complexity. - (code) This one also uses a for loop, but starts at the beginning of the strand and works it's way forward. The first submission is still the simplest and best in my opinion. I've also noticed every single submission so far does not use descriptive variable names, which they should.
- (code) Lo and behold! This one does use descriptive variable names. He also documents his code with comments very well. In Ruby we were told not to have any comments, but I remember Lovisa saying that lots of people put comments in their javascript code.
- (code) Oooh! This one is very different from the others. They use
letto define variables within thecomputefunction, which I have learned will scope it to the enclosing block. They make use of a while loop, which will stop whenigets to zero (they are working backwards from the end of the strand).
- (code) I like that they defined the DNA to RNA dictionary within the class, I didn't do that. They use a for loop and add on to it the RNA transcription. They also considered the edge case where there is no DNA key, and put a space in it's place.
- (code) This one was interesting. They pulled pieces apart by making functions to do those pieces, which was good. They also made a function to transcribe RNA back to DNA, which is why their mapping object has to be more complex ('A' to 'U' for RNA and 'A' to 'T' for DNA).
- (code) This guy also defined the mapping inside the class (why did I not think to do this?). He also makes use of a
forloop and appends the mapped value to a new variable. - (code) Oooh this was super cool. They used
.replaceand some regex. This was very clean and definitely my favorite. - (code) This guy didn't define a map, but had four if statements to transcribe the strand, not very DRY. I know this guy though so it's cool because he's a cool guy.