I hereby claim:
- I am jasonseminara on github.
- I am jasonseminara (https://keybase.io/jasonseminara) on keybase.
- I have a public key ASArAAJZqOZT7hFBOarI1dUNrD0g3FIvAOR0u-RudC7RiQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
### Keybase proof | |
I hereby claim: | |
* I am jasonseminara on github. | |
* I am jasonseminara (https://keybase.io/jasonseminara) on keybase. | |
* I have a public key ASBbXJuctRaJZcwDrmK_S1uZfaw7bXhH3TMutfeL_h8hDwo | |
To claim this, I am signing this object: |
/** | |
* one-line solution with sets! | |
*/ | |
const oneliner = [...new Set(colors.split(' '))].join(' '); | |
console.log(oneliner); | |
/** | |
* WHOAH! let's break that down! | |
*/ |
const colors = 'red orange red yellow green blue yellow indigo violet red indigo orange green blue'; | |
const colorsMapped = colors.split(' ').reduce((set, item, i) => { | |
if (item in set) return set; | |
// if the item isn't in the set, put it in and record its position | |
// don't do any mutations! | |
return { | |
...set, | |
[item]: i, |
const colors = 'red orange red yellow green blue yellow indigo violet red indigo orange green blue'; |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> |
k
<cffunction | |
name="QueryToCSV" | |
access="public" | |
returntype="string" | |
output="false" | |
hint="I take a query and convert it to a comma separated value string."> | |
<!--- Define arguments. ---> | |
<cfargument | |
name="Query" |
bst=(r)-> | |
_root = r | |
compare=(a,b)-> | |
return switch | |
when a is b then 0 | |
when a < b then -1 | |
when a > b then 1 | |
root:()->_root |