- [Why you don't need Meteor][20]
- [Shim status of ES6][1]
- [unshimmable subset of ES5][2]
- [Host objects][3]
- [Why you don't need jQuery][4]
- [All the DOM recursion you'll ever need][5]
- [The heart of pd][6]
- [jQuery library critique][7]
- [klass][8]
- [tiny select][9]
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
// Original - @Gozola. This is a reimplemented version (with a few bug fixes). | |
window.WeakMap = window.WeakMap || (function () { | |
var privates = Name() | |
return { | |
get: function (key, fallback) { | |
var store = privates(key) | |
return store.hasOwnProperty("value") ? | |
store.value : fallback | |
}, |
#Why it's bad.
So, the problem with this...
function formatCurrency (data) {
// format germany price
var els = document.querySelectorAll('.price');
for (var i=0; i<els.length; i++) {
var price = parseInt(els[i].innerHTML.replace(/[^0-9]*/,''));
var curr = els[i].getAttribute('data-currency');