- 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
- 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?
This file contains 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, PropTypes } from 'react'; | |
class SimpleAddNewForm extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { value: '' } | |
this.handleChange = () => this._handleChange(); | |
this.handleClick = () => this._handleClick(); | |
} |
This file contains 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
{ | |
"always_show_minimap_viewport": true, | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme", | |
"font_face": "Inconsolata", | |
"font_options": | |
[ | |
"gray_antialias" | |
], | |
"font_size": 18, |
Use this gist to write down notes and questions as you read through the lesson plan. https://github.com/turingschool/lesson_plans/blob/master/ruby_04-apis_and_scalability/react_in_theory.markdown
Minitest provides some handy methods which allows us to check for falsey/truthy values and actually compare values.
assert
- The first argument passed to this method is whatever we are going to assert is truthy. For example,
assert "Hello"
returns true since"Hello"
is a truthy value. - The second argument passed to this method is an optional error message. If no argument is given, it will default to
Failed Assertion, no message given
. For example,assert nil, "Nil is falsey"
will fail, and the error message printed in the terminal will be"Nil is falsey"
.
- The first argument passed to this method is whatever we are going to assert is truthy. For example,
assert_equal
- This method takes two arguments. As the name of the method indicates, we are asserting an equality of the two given values.
refute
This file contains 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
$(document).ready(function() { | |
renderAllItems(); | |
fetchToken(); | |
}); | |
function fetchToken() { | |
$.ajax({ | |
url: '/api/v1/env_variables.json', | |
type: 'GET', | |
success: function(response) { |