function Card({ children, title }) {
return (
<div className="card">
<div className="card-content">
<h1>{title}</h1>
{children}
</div>
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
function myFunc() { | |
let count = 0; | |
return function () { | |
if (count < 3) { | |
console.log(count); | |
count++; | |
} else { | |
console.error('maximum count has been reached'); | |
throw 'max count'; | |
} |
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
function fizzBuzz(n) { | |
for (let i = 1; i <= n; i++) { | |
if (i % 15 === 0) return 'FizzBuzz' | |
if (i % 5 === 0) return 'Buzz' | |
if (i % 3 === 0) return 'Fizz' | |
else { | |
return i | |
} | |
} | |
} |
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
function mergeAlternately(word1, word2) { | |
// get max length of each word | |
let m = word1.length, | |
n = word2.length, | |
// starting word | |
result = ''; | |
// if either index is less than word length, add current letter to result | |
for (i = 0; i < Math.max(m, n); i++) { |
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
var kidsWithCandies = function(candies, extraCandies) { | |
let greatestNumber = candies.map(i => i).sort((a, b) => b - a)[0]; | |
let output = []; | |
for (let i in candies) { | |
if (candies[i] + extraCandies >= greatestNumber) { | |
output.push(true); | |
} | |
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
var reverseVowels = function (s) { | |
let vowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']; | |
let strArr = [...s]; | |
let foundVowels = []; | |
for (let i = s.length - 1; i >= 0; i--) { | |
if (vowels.includes(s[i])) { | |
foundVowels.push(s[i]); | |
} | |
} | |
for (let j = 0; j < strArr.length; j++) { |
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
var reverseWords = function (s) { | |
let strArr = s | |
.replace(/\s{2,}/g, ' ') | |
.trim() | |
.split(' ') | |
.reverse(); | |
return strArr.join(' '); | |
}; |
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
<ul class="accordion"> | |
<li class="accordion-item"> | |
<input id="s1" class="hide" type="checkbox"> | |
<label for="s1" class="accordion-button"> | |
<span class="title">Real Abstraction: In the Mind but not from There</span> | |
<span class="date">Thu May 6th, 2021 @ 11am PDT</span> | |
</label> | |
<div class="accordion-content"> | |
<p> | |
<span class="speakers">Speakers:</span> |
NewerOlder