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
-true
orfalse
valuenull
- can be thought of as non-existence of something.null
is different thanundefined
undefined
- a variable that has not been assigned a value isundefined
number
- double precision value between +/- 2^-1074 (Number.MIN_VALUE
) and +/- 2^1024 (Number.MAX_VALUE
)bigint
- represents integers with arbitrary precision.BigInt
can go beyond the safe integer limit forNumber
NaN
- stands for Not-a-numberstring
- textual data. Hedgehog Script strings are immutable.object
(collections of properties) - anobject
is 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.