Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
default value for array - arktype
a
arktype
•
9mo ago
•
5 replies
Tom
default value for array
Is it possible to set the default value for an array to an empty array
?
I
'm trying to do something like this
:
const Thing = type({
array: "number.integer[] = []",
})
const Thing = type({
array: "number.integer[] = []",
})
But I get
But I get
Default value
'
[
]
' must a literal value
`
arktype
Join
This is a friendly space centered around ArkType, TypeScript's 1:1 validator (https://github.com/arktypeio/arktype)
860
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
default value for optional field
a
arktype / questions
10mo ago
Cast empty string in place for literal as default value
a
arktype / questions
6mo ago
type for valid JSON value?
a
arktype / questions
13mo ago