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
Atom Editor Settings and packages... |
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
const addMutation = gql` | |
mutation addPost($title: String!, $description: String!, $image: String!, $ingredients: [String!]!, $instructions: [String!]!) { | |
createRecipe(title: $title, description: $description, image: $image, ingredients: $ingredients, instructions: $instructions) { | |
id | |
title | |
description | |
image | |
ingredients | |
instructions | |
} |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
<style> | |
* { | |
box-sizing: border-box; |
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
/** | |
* Question 1 | |
* | |
* a) What will be logged to the console? | |
* b) How could the params in the call to getData be changed in order to log something else? | |
*/ | |
var getData = function(params) { | |
if (typeof params.accountNumber !== 'number') { | |
return Promise.reject({message: 'accountNumber must be of type: number'}); | |
} else { |
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
// 1 - (a) Reimplement Array.prototype.forEach as a standalone function that accepts an array and a callback | |
// (b) Invoke the function such that it logs the array's values individually on each line | |
// (c) Invoke the function such that it logs the array's indices individually on each line | |
const numberArrayOne = [1, 2, 3, 4, 5] | |
function forEach(list, cb) { | |
for (let i = 0; i < list.length; i++) { | |
cb(list[i], i, list) | |
} |