---
title: HypeXAPI.setDefault
slug: hypexapisetdefault
description: Learn how to use the setDefault function to easily override default values in your code. This document provides examples for overriding specific default values or all default values for a certain key. Find out how this function can be helpful in changing 
docTags: 
createdAt: 2022-05-04T09:30:36.000Z
---

The setDefault function allows you to override a global default by key or to override all defaults at once by passing in an object.

To override a specific default, pass in the key as the first argument and the value you want to set as the second argument. For example, to override the default for the key "name", you would do the following:

```javascript
HypeXAPI.setDefault("name", "John Doe");
```

In the following example, the setDefault function is being used to override the defaults for the key "verbs". The new default values that are being set are an object with the keys "started" and "finished". Each of these keys has an id and display value.

This function can be useful if you want to change the default values for a specific key or for all keys at once.

```javascript
HypeXAPI.setDefault("verbs", {
    "started": {
        "id": "http://adlnet.gov/expapi/verbs/started",
        "display": {
            "en-US": "started"
        }
    },
    "finished": {
        "id": "http://adlnet.gov/expapi/verbs/finished",
        "display": {
            "en-US": "finished"
        }
    }
}
```

Verbs constitute a special case over defaults like (object, context etc.). If a verb statement is referenced later in the GUI, it is also looked up in ADL.verbs as a fallback. This allows for the use of common verbs in the GUI without having to duplicate them in your default verbs, as they will be fetched from the fallback.

