I am trying to have this function run every 2 seconds. So far the 'test' is logging repeatedly but the dom manipulation is occurring successfully once. After that it is not updated with the new time in subsequent intervals. Is there a built in function I am missing to "action/verb" this line? I am using the Moment JS library to retrieve the current time in case that is useful context.
var domstrings = {
timebox : '#time',
}
let m = moment()
let currentTime = m.format('h: m: s')
setInterval(function(){
console.log('test');
let currentTime = m.format('h: m: s')
document.querySelector(domstrings.timebox).textContent = currentTime;
}, 2000)