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
/* | |
* Programming Quiz: JuliaJames (4-1) | |
*/ | |
//version using an extra string for concatecate the result | |
var x = 1; | |
while (x < 21) { | |
fizzbuzz = ""; //string init in every loop cycle | |
if (x%3 === 0) fizzbuzz += "Julia"; //concat Julia if x mod 3 equals 0 | |
if (x%5 === 0) fizzbuzz += "James"; //concat James if x mod 5 equals 0 |
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
/* | |
* Programming Quiz: Inline Functions (5-6) | |
*/ | |
// don't change this code | |
function emotions(myString, myFunc) { | |
console.log("I am " + myString + ", " + laugh(2)); | |
} | |
// your code goes here |
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
/* | |
* Programming Quiz: I Got Bills (6-9) | |
* | |
* Use the .map() method to take the bills array below and create a second array | |
* of numbers called totals. The totals array should contains each amount from the | |
* bills array but with a 15% tip added. Log the totals array to the console. | |
* | |
* For example, the first two entries in the totals array would be: | |
* | |
* [57.76, 21.99, ... ] |
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
/* | |
* Programming Quiz: Nested Numbers (6-10) | |
* | |
* - The `numbers` variable is an array of arrays. | |
* - Use a nested `for` loop to cycle through `numbers`. | |
* - Convert each even number to the string "even" | |
* - Convert each odd number to the string "odd" | |
*/ | |
var numbers = [ |
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
/* | |
* Programming Quiz: Umbrella (7-1) | |
*/ | |
var umbrella = { | |
color: "pink", | |
isOpen: true, | |
open: function() { | |
if (umbrella.isOpen === true) { | |
return "The umbrella is already opened!"; |
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
/* | |
* Programming Quiz: Facebook Friends (7-5) | |
* | |
* Create an object called facebookProfile. The object should have 3 properties: | |
* your name | |
* the number of friends you have, and | |
* an array of messages you've posted (as strings) | |
* The object should also have 4 methods: | |
* postMessage(message) - adds a new message string to the array | |
* deleteMessage(index) - removes the message corresponding to the index provided |
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
/* | |
For this quiz, can you use this script, which is linked in the <head> of index.html, | |
to change the boring placeholder image to a picture of a cute animal? | |
Remember, you'll need to pass a function into the jQuery object to run | |
when the document is ready. | |
Unfortunately, placepuppy is no longer available. Here's a link to a random | |
animal image on lorempixel.com: |
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 } from 'react'; | |
import { Route } from 'react-router-dom' | |
import ListContacts from './ListContacts' | |
import CreateContact from './CreateContact' | |
import * as ContactsAPI from './utils/ContactsAPI' | |
class App extends Component { | |
state = { | |
contacts: [] | |
} |