---
title: "toBeLessThan() | Grafana k6 documentation"
description: "Asserts that a numeric value is less than another value"
---

# toBeLessThan()

The `toBeLessThan()` method asserts that a numeric value is less than another value.

## Syntax

JavaScript ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```javascript
expect(actual).toBeLessThan(expected);
expect(actual).not.toBeLessThan(expected);
```

## Parameters

Expand table

| Parameter | Type   | Description                  |
|-----------|--------|------------------------------|
| expected  | number | The value to compare against |

## Returns

Expand table

| Type | Description     |
|------|-----------------|
| void | No return value |

## Description

The `toBeLessThan()` method performs a numeric comparison using the `<` operator. Both values must be numbers, or the assertion will fail.

## Usage

JavaScript ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```javascript
import { expect } from 'https://jslib.k6.io/k6-testing/0.6.1/index.js';

export default function () {
  expect(3).toBeLessThan(5);
  expect(10).toBeLessThan(10.5);
  expect(-5).toBeLessThan(-1);
  expect(-1).toBeLessThan(0);
  expect(0).toBeLessThan(1);
}
```
