scrollto div javascript code example
Example 1: js scrolling in div
var divElement = document.getElementById("div");
divElement.scroll({
top: divElement.scrollHeight,//scroll to the bottom of the element
behavior: 'smooth' //auto, smooth, initial, inherit
});
Example 2: how to scroll through an object js
// Requiring the lodash library
// console: npm i --save lodash
const _ = require("lodash")
// Use of _.forEach() method
_.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
console.log(key)
})