Has Value

Checks if a value is truthy, meaning it is not falsy.

CategoryValidations
AuthorPolgubau
Since1.0.0
Last Updated2025-03-17
TypeSync
CompatibilityUniversal

Example

  • Input

    hasValue('Hello')

    Output:

    true
  • Input

    hasValue(null)

    Output:

    false

Return

Returns `true` if the value is truthy, otherwise `false`.

Type: boolean

Props

NameTypeDefaultRequiredDescription
valueanynullNoThe value to check.

Notes

Truthy values are those that are not falsy, like `1`, `'Hello'`, or `{}`.

Tags

  • validation
  • truthy
  • boolean

Related