How to smooth scroll in JavaScript

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

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