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
function largest(arr) { | |
return arr.map(function(val){ | |
return val.reduce(function(prev, current){ | |
return current > prev ? current : prev; | |
}); | |
}); | |
} | |
console.log(largest([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]])); |
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
function end(str, target) { | |
return str.substr(str.length - target.length) === target ? true : false; | |
} | |
end('platypus', 's'); | |
end('I\'m pretty sure this thing is on', 'on'); |
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
const findOdd = (arr) => arr.reduce((a,b) => a ^ b); | |
findOdd([1,1,2,-2,5,2,4,4,-1,-2,5]) |
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
<ul> | |
<li>Item 1 | |
<ul> | |
<li>Item 1.1 | |
<ul> | |
<li>Item 1.1.1</li> | |
<li>Item #1.1.2 | |
<ul> | |
<li>Item 1.1.2.1</li> | |
</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
{ | |
"hello": "world" | |
} |
OlderNewer