function parseUser(user) { const html = `
${user.firstname + ' ' + user.lastname} Joined ${parseDate(new Date(user.date))} Gender: ${user.gender} Birthday: ${parseMonth(user.month) + ' ' + user.day + ', ' + user.year} User ID: ${user.user_id}
` return html } function render() { const html = `
${data.users.map(u => parseUser(u)).join('')}
` add(html, 'users') const load = `
Load more users
` if (page !== -1) { add(load, 'load') } else { remove('load') } } var page = 0 var data = { users: [] } async function load() { const users = (await loaduserspage(page)).json if (users.length === 0) { page = -1 } else { page++ } data.users.push(... users) render() } header(false, true) load()