How to smooth scroll in JavaScript

DOM
Last updated Apr 28, 2018
<div id="box"></div>
const element = document.querySelector("#box");

element.scrollIntoView({ behavior: "smooth" });