# Tutorial / Example: Simple A/B Test

This document introduces an example using the JavaScript SDK from Hackle's supported SDKs. The purpose of the example is to:

1. Understand what code work is needed.
2. Experience the features of the SDK.

## Example: Simple A/B Test

The example performs the following:

1. Accepts an arbitrary User Identifier as input.
2. Clicks the **Variation Distribution** button.
3. Performs variation distribution and tracks the `hackle_test_event_key` event.

{% hint style="info" %}
View example code and practice link

[Hackle JavaScript SDK Integration and Feature Example](https://codepen.io/hackle-example/pen/wvdedja)

Tip. Reading the [JavaScript](/en/development-guide/javascript.md) documentation alongside the comments in the code will help you understand it quickly.
{% endhint %}

## Notes

1. **The example runs based on an A/B test created by Hackle for demonstration purposes. This example A/B test has the following characteristics:**
   * It is configured to let you experience multiple types of distribution reasons.
   * Entering `apple` as the User Identifier returns variation A, and `banana` returns variation B.
   * For other input values, the variation is determined according to the Variation Distribution Principle.
2. **To run this example with an A/B test you created in the Hackle Dashboard, you need to modify the SDK Key and Experiment Key in the JS tab.**

![](/files/VwsKWpHF64PfZpJjAnRL)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hackle.io/en/development-guide/sdk/sdk-example.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
