Skip to content

Instantly share code, notes, and snippets.

View BrentonCozby's full-sized avatar

Brenton Cozby BrentonCozby

View GitHub Profile
@BrentonCozby
BrentonCozby / arrayDepth.js
Created January 8, 2020 22:41
arrayDepth function
// 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)
}
@BrentonCozby
BrentonCozby / interview-questions.js
Last active May 22, 2018 01:11
JavaScript problems for an interview at a financial services company
/**
* 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 {
@BrentonCozby
BrentonCozby / form.html
Last active August 23, 2017 01:10
form css example
<!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;
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
}
Atom Editor Settings and packages...