Identify the purpose of the given function and rewrite it in a simpler form.
function greetUser(name) {
    alert(`Hello, ${name || 'there'}!`);
  }
The purpose of the function is to greet the user by displaying a message, either using the user's name or with the word 'there' as a default, in case no name is provided. Here is the function rewritten in a simpler form:

```javascript
function greetUser(name) {
    if (!name) {
        name = 'there';
    }
    alert(`Hello, ${name}!`);
}
```
Complete the following task based on the instruction and optional input provided.### Instruction:
Identify the purpose of the given function and rewrite it in a simpler form.

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

### Output:
The purpose of the function is to greet the user by displaying a message, either using the user's name or with the word 'there' as a default, in case no name is provided. Here is the function rewritten in a simpler form:

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