> For the complete documentation index, see [llms.txt](https://demirels-organization.gitbook.io/javascript-tutorial/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://demirels-organization.gitbook.io/javascript-tutorial/numbers.md).

# Numbers

In JavaScript, a number is a numeric data type that can be an integer (e.g. 1, 2, 3) or a floating-point number (e.g. 1.5, 3.14, 5.0).

You can convert a number to a string by using the `toString()` method:

```javascript
let num = 123;
let str = num.toString();
console.log(typeof str); // Outputs "string"
```

You can also use the `String()` function to convert a number to a string:

```javascript
let num = 123;
let str = String(num);
console.log(typeof str); // Outputs "string"
```

If you try to perform an operation that is not allowed for numbers (e.g. dividing a string by a number), the result will be `NaN`, which stands for "Not a Number".

For example:

```javascript
let num = 'foo';
let result = num / 2;
console.log(result); // Outputs NaN
```

Let's look at an example of Numbers in the context of a Sports games
