user
Identify the purpose of the given function and rewrite it in a simpler form.

Additional Context:
function greetUser(name) {
    alert(`Hello, ${name || 'there'}!`);
  }

Answer:
assistant
The purpose of this function is to greet the user by displaying an alert with a personalized message. This can be rewritten as: 

function greetUser(name) {
    if (name) {
        alert(`Hello, ${name}!`)
    } else { 
        alert('Hello, there!')
    }
}