Skip to content

Instantly share code, notes, and snippets.

View biglovisa's full-sized avatar
🌍
Patch is hiring!

Lovisa Svallingson biglovisa

🌍
Patch is hiring!
View GitHub Profile
@biglovisa
biglovisa / solution.js
Created July 10, 2016 23:28
SimpleAddNewForm-solution
import React, { Component, PropTypes } from 'react';
class SimpleAddNewForm extends Component {
constructor(props) {
super(props);
this.state = { value: '' }
this.handleChange = () => this._handleChange();
this.handleClick = () => this._handleClick();
}
@biglovisa
biglovisa / z.md
Created April 24, 2017 01:06
superfizz

Superfizz

Iteration 1

  • Print all numbers 1-10 to the screen.

Iteration 2

  • Print all numbers 1-10 to the screen.
  • For multiples of 3, print "Fizz" instead of the number
@biglovisa
biglovisa / data-types.md
Created May 4, 2017 17:13
data types: check-ins

Data types: check-ins

Greeting

  • Create three variables - name, age, and, homeTown - and assign them values.
    • Print "My name is X and I am Y years old. I live in Z.", where X, Y, Z represents one of your three variables.

Creating a sentence

  • Assign the value tomatoes to a variable expression
@biglovisa
biglovisa / logical-operators.md
Created May 4, 2017 17:29
Logical operators: check-ins

Logical Operators

Logical operators

  • Write down two statements using the || operator and two using the && operator.
    • Verifying the return value of the statements in the Node console first, let the person next to you guess whether the four statements will evaluate to true or false.
  • What does "hello" || false evaluate to? Why?
  • What does "hello" && undefined evaluate to? Why?
  • What does "hello" && "it's me" evaluate to? Why?
  • What does "hello" || "it's me" evaluate to? Why?
@biglovisa
biglovisa / control-flow.md
Created May 4, 2017 17:53
Control flow: check-ins

Control Flow

Student grades

  • Create an if/else statement which tells you if a student should get an A, B, C, or D based on their score.
    • A: 100 - 95
    • B: 94 - 85
    • C: 84 - 75
    • D: 74 or below
@biglovisa
biglovisa / functions.md
Last active May 10, 2017 02:23
Functions: check-ins

Functions

Check-ins 1

  • What is a function? Give an example of a daily task which could be abstracted into a function.
  • In your console, create a named function and an anonymous function.
  • Create a function called myFunctionName. What does myFunctionName return? What does myFunctionName() return?
  • What does a function return by default?
  • Create a function which returns "You are the world's greatest" when invoked.

Functions: exercises

  • Answer the following questions with the person sitting next to you:

    • What does a function return by default?
    • What is the return keyword? What does it do?
    • Do you always have to give a function a name?
    • What is the difference between this: myFunctionName and myFunctionName()?
    • What is the function signature?
  • Create a function which takes the arguments name and jobTitle.

@biglovisa
biglovisa / array.md
Created May 9, 2017 19:51
Array exercises

Array exercises

Foundations

  • Create an empty array
  • Add a few elements to the end of the array
  • Add an element to the beginning of the array
  • Remove the last element from the array
  • Remove the first element from the array
  • Given an array containing the elements: "orange", "carrot", "lemon", "pomegranate", "blood orange", "apple"
@biglovisa
biglovisa / iterating.md
Created May 9, 2017 19:53
iteration exercises

Iterating over collections

Summing integers

  • Given the array numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], iterate over the array and add all numbers together.

Multiplying and summing integers

  • Given the array numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], iterate over the array and multiply all the integers by themselves, and sum them together.
@biglovisa
biglovisa / report-card.html
Created June 1, 2017 02:15
Starter HTML for dom lesson
<h1>Report Card</h1>
<p>Student Name: <span class="student">Your Name Here</span></p>
<ul>
<li>Physics, <span class="grade">D</span></li>
<li>Calculus 2, <span class="grade">F+</span></li>
<li>English Literature, <span class="grade">E</span></li>
</ul>