100 Days of Code, Day 10:
23 June 2017
Today’s Progress:
Finished up Section 10 where we went over functions. I am into Arrays and am halfway through it.
We did a few algorithms and two of which we had to research to actually get the answer.
We had the isEven()
algorithm to see if a number is even, factorial()
to calculate factorials, and snakeToKebab()
to change a string with dashes in between words to underscores.
I remembered doing the isEven()
. It wasn’t hard at all. I calculated factorials on Free Code Camp, and I remembered the string methods of split()
, join()
, and replace()
.
I wanted to use replace()
almost immediately and so I went to Dash Docs and looked up replace()
but it didn’t seem to be what I wanted. So I went to Free Code Camp and looked at my old solutions and cobbled together an algorithm that worked but needed to be refactored to use replace()
. Using replace()
, I would need a regular expression, in this case, /-/g
.
Thoughts:
I was excited to code those algorithms. I wasn’t sure if we would do some algorithm type stuff but we did. I was really glad for that.
Link to work:
The repo.
Gist: