has_data function is used to check the object is null
, undefined
, ''
(Empty), empty map
and set
and []
.
If we have data it will return true
else flase
.
$ npm install has-data
import { has_data } from '@rakeshsagalagatte/has_data'
# watch mode
console.log(has_data(Array.of(['2', '3']))) // result to true
console.log(has_data('a')) // result to true
console.log(has_data(23)) // result to true
console.log(has_data({ 'name':'abcd' })) // result to true
console.log(has_data('')) // result to flase
console.log(has_data(null)) // result to flase
console.log(has_data(undefined)) // result to flase
console.log(has_data([])) // result to flase