Kommentare
Lauf: Roblox: DOORS
type function simple_keyof(ty)
-- Ignoring unions or intersections of tables for simplicity.
if not ty:is("table") then
error("Can only call keyof on tables.")
end
local union = nil
for property in ty:properties() do
union = if union then types.unionof(union, property) else property
end
return if union then union else types.singleton(nil)
end
type person = {
name: string,
age: number,
}
--- keys = "age" | "name"
type keys = simple_keyof<person>
Lauf: Roblox: DOORS
function ispositive(x)
return x > 0
end
print(ispositive(1))
print(ispositive("2"))
function isfoo(a)
return a == "foo"
end
print(isfoo("bar"))
print(isfoo(1))
1 bis 7 von insgesamt 7 angezeigt
Gaboprogames Informationen
Third Member of 3DG
Beigetreten
Online
Läufe
6
Gespielte Spiele
Beobachtete Spiele

Colombia

