Skip to content

Instantly share code, notes, and snippets.

@pvanschy
pvanschy / miniLinter.js
Created February 26, 2021 07:14 — forked from codecademydev/main.js
Codecademy export
let story = 'Last weekend, I took literally the most beautiful bike ride of my life. The route is called "The 9W to Nyack" and it actually stretches all the way from Riverside Park in Manhattan to South Nyack, New Jersey. It\'s really an adventure from beginning to end! It is a 48 mile loop and it basically took me an entire day. I stopped at Riverbank State Park to take some extremely artsy photos. It was a short stop, though, because I had a really long way left to go. After a quick photo op at the very popular Little Red Lighthouse, I began my trek across the George Washington Bridge into New Jersey. The GW is actually very long - 4,760 feet! I was already very tired by the time I got to the other side. An hour later, I reached Greenbrook Nature Sanctuary, an extremely beautiful park along the coast of the Hudson. Something that was very surprising to me was that near the end of the route you actually cross back into New York! At this point, you are very close to the end.';
let overusedWords = ['really
@pvanschy
pvanschy / teamStats.js
Created February 9, 2021 03:22 — forked from codecademydev/app.js
Codecademy export
const team = {
_players: [
{
firstName: 'Pablo',
lastName: 'Sanchez',
age: 11
},
{
firstName: 'Lionel',
lastName: 'Messi',
@pvanschy
pvanschy / mealMaker.js
Created February 9, 2021 02:53 — forked from codecademydev/app.js
Codecademy export
const menu = {
_courses: {
appetizers: [],
mains: [],
desserts: []
},
get appetizers(){
return this._courses.appetizers;
},
get mains(){
@pvanschy
pvanschy / whaleSpeak.js
Last active February 4, 2021 06:20 — forked from codecademydev/main.js
Codecademy export
let input = 'a whale of a deal!';
const vowels = ['a', 'e', 'i', 'o', 'u'];
let resultArray = [];
for(let i = 0; i < input.length; i++){
for(let j = 0; j < vowels.length; j++){
if(input[i] === vowels[j]){
if(input[i] === 'e'){
resultArray.push('ee')
@pvanschy
pvanschy / trainingDays.js
Created January 28, 2021 03:41 — forked from codecademydev/trainingDays.js
Codecademy export
// The scope of `random` is too loose
const getRandEvent = () => {
const random = Math.floor(Math.random() * 3);
if (random === 0) {
return 'Marathon';
} else if (random === 1) {
return 'Triathlon';
} else if (random === 2) {
return 'Pentathlon';
const getSleepHours = (day) => {
switch(day){
case 'monday' :
return 8;
break;
case 'tuesday' :
return 7;
break;
case 'wednesday' :
return 7.5;
@pvanschy
pvanschy / rockPaperScissors.js
Created January 27, 2021 08:44 — forked from codecademydev/rockPaperScissors.js
Codecademy export
const getUserChoice = (userInput) => {
userInput = userInput.toLowerCase();
if(userInput === 'rock' || userInput === 'paper' || userInput === 'scissors' || userInput === 'bomb'){
return userInput;
}
else{
console.log("Error: Invalid user input");
}
}
console.log(getUserChoice('rock'));