-
Notifications
You must be signed in to change notification settings - Fork 3
Undefined
Chung Leong edited this page Feb 9, 2024
·
7 revisions
The literal undefined
in Zig is represented as undefined
in JavaScript. You will only encounter it if you explicitly export undefined
.
pub const Undefined = undefined;
import { Undefined } from './undefined-example-1.zig';
console.log(Undefined);
undefined
Assigned undefined
to a variable would yield undefined
on the JavaScript side. The variable will simply contain random data.
pub var number: i32 = undefined;
import module from './undefined-example-2.zig';
console.log(module.number);
2863311530