- for
- for + cached length
- for + cached length & new Array(length)
- slice
- cached slice
- Array.form
- Array.apply
Funky bench: arguments to array
wormhole.js — is EventEmitter for communication between tabs
Features
- Cross-domain communication
- SharedWorkers or fallback to localStorage
- IE 8+, Chrome 10+, FireFox 10+, Opera 10+, Safari 6+
- Test coverage (run)
How to inherit native Promise?
/** * @class MyPromise * @extends Promise */ var MyPromise = function (executor) { var promise = new Promise(executor); promise.__proto__ = this.__proto__; return promise; }; MyPromise.prototype = Object.create(Promise.prototype, { constructor: { value: MyPromise } }); MyPromise.prototype.done = function (callback) { this.then(callback); return this; }; MyPromise.prototype.fail = function (callback) { this['catch'](callback); return this; }; MyPromise.prototype.always = function (callback) { this.then(callback, callback); return this; }; MyPromise.all = Promise.all; MyPromise.cast = Promise.cast; MyPromise.reject = Promise.reject; MyPromise.resolve = Promise.resolve;
Sortable v0.4.0: Saving and restoring of the sort.
https://github.com/RubaXa/Sortable/tree/dev#store
new Sortable(el, { group: "localStorage", store: { /** * Get the order of elements. Called once during initialization. * @param {Sortable} sortable * @retruns {Array} */ get: function (sortable) { var order = localStorage.getItem(sortable.options.group); return order ? order.split('|') : []; }, /** * Save the order of elements. Called every time at the drag end. * @param {Sortable} sortable */ set: function (sortable) { var order = sortable.toArray(); localStorage.setItem(sortable.options.group, order.join('|')); } } })
User Timing/Performance, grasp
window.performance — This specification defines an interface to help web developers measure the performance of their applications by giving them access to high precision timestamps.
http://graspjs.com/ — Search, replace, and refactor your JavaScript code based on its structure rather than its text
http://rubaxa.github.io/friday/2014-01-31.html
http://graspjs.com/ — Search, replace, and refactor your JavaScript code based on its structure rather than its text
http://rubaxa.github.io/friday/2014-01-31.html
Оптимизация кода на jQuery. Часть I.
Презентация в стиле КО: jQuery.fn.show/hide, jQuery.fn.data и т.п.
http://rubaxa.github.io/friday/2014-01-24.html
https://github.com/RubaXa/rubaxa.github.io
http://rubaxa.github.io/friday/2014-01-24.html
https://github.com/RubaXa/rubaxa.github.io
Пятничный формат
FileAPI.saveAs, b-shortcut.js, jQuery.event.tap.js
https://github.com/RubaXa/rubaxa.github.io
http://rubaxa.github.io/friday/2014-01-17.html
Pilot.js: profiling (1000 iterations)
1660ms, 587492 calls: jQuery.Deferred + jQuery.Events
1170ms, 378492 calls: MyDeferred + jQuery.Events
470ms, 169288 calls: MyDeferred + MyEventEmitter
1170ms, 378492 calls: MyDeferred + jQuery.Events
470ms, 169288 calls: MyDeferred + MyEventEmitter
Ярлыки:
JavaScript,
jQuery,
performance,
Pilot
Подписаться на:
Сообщения (Atom)