| Сообщение от Nexus | 
	| $('html,body').animate({ scrollTop: $([target, `a[name="${target.replace(/^#+/g, '')}"]`].join(', ')).first().offset().top - delta
 }, duration);
 | 
	
как вариант...
 
$('html,body').animate({
      scrollTop: $(`${target},a[name="${target.slice(1)}"]`).offset().top - delta
    }, duration);