| `max()` | Returns the highest value, ignoring NaN values. | Returns NaN if any NaN values exist. |
| `min()` | Returns the lowest value, ignoring NaN values. | Returns NaN if any NaN values exist. |
| `mean()` | Computes the average value, ignoring NaN values. | Returns NaN if any NaN values exist. |
| `std()` | Calculates the standard deviation, ignoring NaN. | Returns NaN if any NaN values exist. |
| `median()` | Returns the median value, ignoring NaN values. | Returns NaN if any NaN values exist. |
| `count()` | Counts only valid (non-NaN) values. | Counts all values, including NaN. |
| `last()` | Returns the most recent non-NaN value. | Returns the last value, even if it is NaN. |
| `first()` | Returns the oldest non-NaN value. | Returns the first value, even if it is NaN. |
| `sum()` | Computes the total sum, ignoring NaN values. | Returns NaN if any NaN values exist. |
##### The following calculations are executed over the provided above arguments:
**Example usage: default (`ignoreNaN = true`)**
```javascript
var avgTemp = temperature.mean();
var tempMax = temperature.max();
var valueCount = temperature.count();
```
**Output:**
```json
{
"avgTemp": 72.92,
"tempMax": 73.58,
"valueCount": 3
}
```
**Example usage: explicit (`ignoreNaN = false`)**
```javascript
var avgTemp = temperature.mean(false); // Returns NaN if any NaN values exist
var tempMax = temperature.max(false); // Returns NaN if any NaN values exist
var valueCount = temperature.count(false); // Counts all values, including NaN
```
**Output:**
```json
{
"avgTemp": "NaN",
"tempMax": "NaN",
"valueCount": 4
}
```
##### Function return format:
The script should return a JSON object formatted according to the [ThingsBoard Telemetry Upload API](${siteBaseUrl}/docs${docPlatformPrefix}/user-guide/telemetry/#time-series-data-upload-api/).
The return value must match one of the supported telemetry upload formats.