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
"use strict"; | |
const expect = require("expect"); | |
/** | |
* Write a Binary Search Function using pure recursion | |
*/ | |
const binarySearch = (sorted, value, index = 0) => { | |
// Found the middle point in the sorted array |
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
const messages = { | |
year: { singular: 'year', plural: 'years', denominator: 365, inSeconds: 31536000 }, | |
day: { singular: 'day', plural: 'days', denominator: 24, inSeconds: 86400 }, | |
hour: { singular: 'hour', plural: 'hours', denominator: 60, inSeconds: 3600 }, | |
minute: { singular: 'minute', plural: 'minutes', denominator: 60, inSeconds: 60 }, | |
second: { singular: 'second', plural: 'seconds', inSeconds: 1 } | |
} | |
function pluralize(value, unit) { | |
if (value === 1) return messages[unit].singular; |
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
.type.storage, | |
.type.storage.declaration, | |
.storage.class.modifier { | |
font-family: 'Operator Mono Book'; | |
} | |
.type.storage.arrow.function { | |
font-family: 'Fira Code' | |
} |
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
{ | |
"workbench.colorTheme": "Nord", | |
"editor.fontFamily": "Operator Mono Book", | |
"vscode_custom_css.imports": ["file:///home/huskyglass-2/.vscodeconfigs/styles.css"], | |
// Enables font ligatures | |
"editor.fontLigatures": true, | |
// Controls whether the editor should render whitespace characters | |
"editor.renderWhitespace": "none", |