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
Show hidden characters
{ | |
"env": { | |
"browser": true, | |
"commonjs": true, | |
"es6": true, | |
"node": true | |
}, | |
"extends": [ | |
"standard" | |
], |
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
////////////////////// | |
// Functional class // | |
////////////////////// | |
const Dog = function(name, breed, age){ | |
var dog = { | |
name: name, | |
breed: breed, | |
age: age, | |
happiness: 50, |
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
/* | |
Write a function that takes a string as input and returns the string reversed. | |
Do NOT use the native .reverse() method. | |
reverseString("never") // returns "reven" | |
Strategy: | |
Given a string, split the string in an array of characters | |
Loop backwards through the array starting from the last index | |
Make a new string by concatenating each character |