This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
background-color: #fafafa; | |
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif; | |
margin: 0; | |
padding: 0; | |
} | |
p { | |
font-family: Arial, Helvetica, sans-serif; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getAnswer(question) { | |
const answer = prompt(question); | |
return answer; | |
} | |
function start() { | |
let name = getAnswer("What is your name?") | |
alert("Hello " + name) | |
name = getAnswer("What is your name?") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let animals = [ | |
{ | |
type: "cat", | |
name: "Floof", | |
votes: 0 | |
}, | |
{ | |
type: "dog", | |
name: "Spot", | |
votes: 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function Note() { // creating a function | |
const match = useRouteMatch(); // calling a function and saving it in a variable | |
const { noteId } = useParams(); | |
const note = useSelector(state => state.notes.find(n => n.id === noteId)); // calling a function with a parameter | |
return ( // returning something from a function | |
<div className="container mt-3"> | |
{ (!note) ? <Redirect to="/notfound"/> : | |
<Switch> | |
<Route path={`${match.path}/edit`}> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A prompt that asks a question and only allows certain answers, case insensitive | |
*/ | |
class AcceptedAnswersPrompt { | |
constructor(question, acceptedAnswers) { | |
this.question = question; | |
this.acceptedAnswers = acceptedAnswers; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A prompt that asks a question and only allows certain answers, case insensitive | |
*/ | |
class QuestionPrompt { | |
constructor(question, acceptedAnswers) { | |
this.question = question; | |
this.acceptedAnswers = acceptedAnswers; | |
} | |
getAcceptedAnswer(potentialAnswer) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Call the render function when the page loads in using the jquery ready function | |
$(function() { | |
renderDishList(); | |
}) | |
function createDish() { | |
// grab the stuff from the form and use that to create a new object | |
const dish = { | |
title: $("#title-input").val(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react' | |
import PostList from './components/PostList' | |
export default class App extends Component { | |
render() { | |
return ( | |
<div> | |
This text is in App.js | |
<PostList/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
margin: 0; | |
background-color: #fafafa; | |
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif; | |
} | |
button { | |
border: 0; | |
padding: 15px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Target Practice: Flexbox</title> | |
<link rel="stylesheet" href="target-practice-flexbox.css"> | |
</head> | |
<body> |