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
// Normal function | |
function isNotEmpty(paper) { | |
return paper !== ""; | |
} | |
// Arrow function | |
const isNotEmpty = (paper) => { | |
return paper !== ""; | |
} |
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> | |
<head> | |
<meta charset="utf-8"> | |
<title>Some Page</title> | |
</head> | |
<body> | |
<nav> | |
<h1>Chairs</h1> | |
<ul> |
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
class AddressBook { | |
constructor() { | |
this.entries = []; | |
} | |
// get all your entries | |
getAll() { | |
} |
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
class AcceptedAnswerPrompt { | |
constructor(acceptedAnswers, ignoreCapitalization) { | |
this.acceptedAnswers = acceptedAnswers; | |
this.ignoreCapitalization = ignoreCapitalization; | |
} | |
checkIfAccepted(answer) { | |
// return true if it's in the list, false if it's not | |
for(const acceptedAnswer of this.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
body { | |
margin: 0; | |
padding: 0; | |
font-family: Arial, Helvetica, sans-serif; | |
} | |
/***** Navbar *****/ | |
.navbar { |
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
// The same thing as the other one, I just changed the syntax of the first two lines to ES6 Classes, if that makes it clearer | |
class List { | |
countSpecDigits(integersList, digitsList){ | |
// keep a tally of the digits that I see that I'm supposed to count | |
const tallyList = digitsList.map(number => [number, 0]); | |
// loop over the list of integers | |
for(const integer of integersList) { | |
const integerDigitList = String(integer).split("").map(Number); | |
for(const digit of integerDigitList) { |
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
class AcceptedAnswerPrompt { | |
constructor(acceptedAnswers, ignoreCapitalization) { | |
this.acceptedAnswers = acceptedAnswers; | |
this.ignoreCapitalization = ignoreCapitalization; | |
} | |
checkIfAccepted(answer) { | |
// return true if it's in the list, false if it's not | |
for(const acceptedAnswer of this.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
/* | |
* | |
* | |
* This code was written specifically for a CodeWars kata, and is different than the code | |
* we worked through in class because it is designed for a different purpose. | |
* It shows that there is not one right way to break things into classes/objects (or functions) | |
* it depends on what your goals are and what you need it to do! | |
* | |
* Also, this isn't doctrine on how to solve this problem, |
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>Document</title> | |
</head> | |
<body> | |
<script src="week2.js"></script> |
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>Document</title> | |
</head> | |
<body> | |
<nav> |