Document the empty constant

This commit is contained in:
Talia 2022-04-12 22:41:10 +02:00
parent f863ef3e7d
commit f7b945c083
Signed by: darkwiiplayer
GPG key ID: 7808674088232B3E

View file

@ -313,3 +313,17 @@
creates that will always point to the newest version of the element.
</p>
</section>
<section>
<h2>The <code>empty</code> constant</h2>
<p>
This symbol will be completely ignored when it appears as a children in any skooma generator.
</p>
<code-block>
const name = undefined
html.div("name: ", name ?? "") // This will generate an (unnecessary) empty text note
html.div("name: ", name ?? null) // This will print a warning to the console (same with undefined)
html.div("name: ", name ?? empty) // This will only generate the first text node
</code-block>
</section>