UNPKG

voluptasmollitia

Version:
22 lines (12 loc) 853 B
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@firebase/database](./database.md) &gt; [DataSnapshot](./database.datasnapshot.md) &gt; [hasChildren](./database.datasnapshot.haschildren.md) ## DataSnapshot.hasChildren() method Returns whether or not the `DataSnapshot` has any non-`null` child properties. You can use `hasChildren()` to determine if a `DataSnapshot` has any children. If it does, you can enumerate them using `forEach()`<!-- -->. If it doesn't, then either this snapshot contains a primitive value (which can be retrieved with `val()`<!-- -->) or it is empty (in which case, `val()` will return `null`<!-- -->). <b>Signature:</b> ```typescript hasChildren(): boolean; ``` <b>Returns:</b> boolean true if this snapshot has any children; else false.