made with esnextbin
Last active
January 24, 2017 03:22
-
-
Save TylorS/ab01ec66d8e21df201802cd3d3f915a6 to your computer and use it in GitHub Desktop.
esnextbin sketch
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>ESNextbin Sketch</title> | |
<!-- put additional styles and scripts here --> | |
</head> | |
<body> | |
<!-- put markup and other contents here --> | |
</body> | |
</html> |
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
import { fromObject, set, get } from '@typed/hashmap'; | |
console.clear(); | |
const initial = fromObject({ | |
a: 1, | |
b: 2, | |
// h: 8, | |
// i: 9, | |
// j: 10, | |
// k: 11, | |
// l: 12, | |
// m: 13, | |
// n: 14, | |
// o: 15, | |
// p: 16, | |
// q: 17, | |
// r: 18, | |
// s: 19, | |
// t: 20, | |
// u: 21, | |
// v: 22, | |
// w: 23, | |
// x: 24, | |
// y: 25, | |
// z: 26 | |
}) | |
console.log(get('a', initial)) | |
console.log(get('p', initial)) | |
console.log(initial) | |
const newMap = set('a', 10, initial); | |
console.log(get('a', newMap)) | |
console.log(get('a', initial)) |
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
{ | |
"name": "esnextbin-sketch", | |
"version": "0.0.0", | |
"dependencies": { | |
"@typed/hashmap": "0.1.0" | |
} | |
} |
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'; | |
var _hashmap = require('@typed/hashmap'); | |
console.clear(); | |
var initial = (0, _hashmap.fromObject)({ | |
a: 1, | |
b: 2 | |
}); | |
// h: 8, | |
// i: 9, | |
// j: 10, | |
// k: 11, | |
// l: 12, | |
// m: 13, | |
// n: 14, | |
// o: 15, | |
// p: 16, | |
// q: 17, | |
// r: 18, | |
// s: 19, | |
// t: 20, | |
// u: 21, | |
// v: 22, | |
// w: 23, | |
// x: 24, | |
// y: 25, | |
// z: 26 | |
console.log((0, _hashmap.get)('a', initial)); | |
console.log((0, _hashmap.get)('p', initial)); | |
console.log(initial); | |
var newMap = (0, _hashmap.set)('a', 10, initial); | |
console.log((0, _hashmap.get)('a', newMap)); | |
console.log((0, _hashmap.get)('a', initial)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment