a bit cleaned up version of my "slides"
disclaimer: this "talk" was done to show some "real life use cases" to simplify the knowledge I mainly got from Axel Rauschmayer's articles
// WAT
event.initMouseEvent( 'click', true, true, window,
123, 101, 202, 101, 202,
true, false, false, false, 1, null );
happily, it's been deprecated
// old, deprecated madness
event.initMouseEvent( type, canBubble, cancelable, view,
detail, screenX, screenY, clientX, clientY,
ctrlKey, altKey, shiftKey, metaKey,
button, relatedTarget );
// new, SANE signature
MouseEvent( type, options );
getting "max" value from given collection
Math.max.apply( Math, collection );
Math.max( ...collection );
function extend( target, source ) {
// extend logic
if ( arguments.length > 2 ) {
var others = Array.prototype.slice.apply( arguments, 2 );
return extend.apply( null, [ target ].concat( others ) );
}
return target;
}
function extend( target, source, ...moreSources ) {
// extend logic
if ( moreSources.length ) {
return extend( target, ...moreSources );
}
return target;
}