Add setInterval and setTimeout functions to JavaScript