const bind = (fn, ctx) => (...args) => fn.call(ctx, ...args);
function a(a,b,c){ console.log(this, a, b, c) }
const someObj = {abc: 100}
const bindedA = bind(a, someObj);
bindedA(123, 456, 789); // -> { abc: 100 } 123 456 789
$('a[href^="#"]').on('click', function(event) {
var target = $( $(this).attr('href') );
if( target.length ) {
event.preventDefault();
$('html, body').animate({
scrollTop: target.offset().top
}, 500);
}
});