So-called promises are now available in JavaScript. Promises are a convenient way to access the results of operations in JavaScript, be they synchronous or asynchronous. The simplest example:
var promise = newPromise(function(resolve) {
setTimeout(function() {
resolve('The time machine worked!');
}, 2014); // see what I did there?
});
promise.then(function(result) {
console.log('Promise resolved.', result);
});
, , .
WebP
WebP — GIF, . Opera 19 WebP .
2D Canvas
Canvas -, . , getContext, alphafalse ( true).
var context = document.querySelector('canvas').getContext('2d', {
'alpha': false
});