Kebab file names

This commit is contained in:
Angelos Chalaris
2023-04-27 21:58:35 +03:00
parent 1d189c709a
commit 61200d90c4
440 changed files with 0 additions and 0 deletions

View File

@ -0,0 +1,20 @@
---
title: Random boolean value
tags: math,random
author: chalarangelo
cover: malibu
firstSeen: 2021-01-20T16:20:08+02:00
lastUpdated: 2021-01-20T16:20:08+02:00
---
Generates a random boolean value.
- Use `Math.random()` to generate a random number and check if it is greater than or equal to `0.5`.
```js
const randomBoolean = () => Math.random() >= 0.5;
```
```js
randomBoolean(); // true
```