Guydo Coding Exercise

by guydog28

HTML

<div id="app"></div>

CSS

body {
  background: #20262E;
  padding: 20px;
  font-family: Helvetica;
}

#app {
  background: #fff;
  border-radius: 4px;
  padding: 20px;
  transition: all 0.2s;
}

li {
  display: 8px 0;
}

.comma-list li {
  display: inline;
}

.comma-list li::after {
  content: ", ";
}

.comma-list li:last-child::after {
    content: "";
}

h2 {
  font-weight: bold;
  margin-bottom: 15px;
}

.done {
  color: rgba(0, 0, 0, 0.3);
  text-decoration: line-through;
}

input {
  margin-right: 5px;
}

React

/**
* This project has three tasks:
*
* 1. Implement the fibonacci and fibonacciArray methods to 
*    do as its jsdoc describes it should do. Replace 
*    placeholder return statements with your implementation.
*    Click run at the top left to test your code output in the 
*.   window to the right.
* 2. Ensure application renders as expected - if not fix any bugs
* 3. Change the display of the list to display the numbers on a 
*    single line, as a comma-separated list.  Do not modify the 
*    structure of the html - modify attributes and/or CSS only.
*
**/
class FibonacciApp extends React.Component {
  constructor(props) {
    super(props)
  }
  
  /**
  * Returns the nth number in the fibonacci sequence, where 
  * n is provided as a parameter.
  *
  * The first two numbers in the fibonacci sequence are 0 and 
  * 1. Each subsequent number is the sum of the previous two 
  * numbers
  *
  * Given this, the first 8 numbers then would be:
  * 0, 1, 1 (0+1), 2 (1+1), 3 (1+2), 5 (2+3), 8 (3+5), 13 (5+8)
  *
  * This method only returns the number requested. So:
  * fibonacci(8) returns 13. fibonacci(1) returns 0;
  *
  * @param {number} n - which place in the sequence to return. 
  *                     starts at 1
  *
  * @return the nth number in the fibonnaci sequence.
  */
  fibonacci(n) {
    return 0;
  }

  
  /**
  * Make calls to the fibonacci(n) function to get each number 
  * in the fibonacci sequence from 1..${count} and add them to 
  * the return array
  * 
  * @param {number} count - how many numbers in the fibonacci sequence 
  * should be returned in the array
  *
  * @return {number[]} the first ${count} numbers in the fibonacci sequence
  *
  */
  fibonacciArray(count) {
    return [0, 1, 2];
  }
  
  /**
  * Output the first 20 numbers in the fibonacci sequence. Do not 
  * change the structure of the HTML elements for 
  * the assignment - the resulting HTML must always be an ol with lis 
  * as its direct children, regardless of how they...