Basic Types
Hedgehog Script has several basic built-in types. These are the complement to constructed types.
Let's discuss both, starting with primitives.
Primitive Values
These are immutable data represented directly at the lowest level of the language.
Here are the list of all primitive types:
boolean-trueorfalsevaluenull- can be thought of as non-existence of something.nullis different thanundefinedundefined- a variable that has not been assigned a value isundefinednumber- double precision value between +/- 2^-1074 (Number.MIN_VALUE) and +/- 2^1024 (Number.MAX_VALUE)bigint- represents integers with arbitrary precision.BigIntcan go beyond the safe integer limit forNumberNaN- stands for Not-a-numberstring- textual data. Hedgehog Script strings are immutable.object(collections of properties) - anobjectis a value in memory which can be referenced by an identifier
The following is an example of some different types
info
The ${} in Hedgehog Script is a placeholder for an expression/variable/operation/etc.
That said placeholder is executed at runtime - its output passed as a String.
Another example of more primitive types:
tip
There are many, many built-in objects available in Hedgehog Script.
Visit Built-in objects - MDN to learn about them.