Bernhard
07/29/2024, 12:22 PMturansky
07/29/2024, 2:22 PMfun f(a: Any?) {
a === null // is null
a === undefined // is undefined
}
turansky
07/29/2024, 2:23 PMare all undefined values from native JS APIs coerced into nulls?From JS API you will receive original values
turansky
07/29/2024, 2:24 PMUnit
Bernhard
07/29/2024, 2:26 PMEdoardo Luppi
07/29/2024, 2:40 PMvoid 0
is used to represent undefined
.
A void 0
variable is passed to external functions with optional parameter, for example.
external class Example {
constructor(one: String, two: String = definedExternally, three: String)
}
val e = Example(one = "o", three = "t")
Translates to
var e = new Example('o', VOID, 't');