Types & Conversion
Last updated
These methods work on any value, regardless of its type - converting between types, copying, dynamic access and runtime assertions.
log "42".toNum() // 42
log [1, 2, 3].clone() // independent copy
log [1, 2, 3].len // 3 (property - no parentheses)Conversion - toStr, toNum, toInt, toBool, toArray, toObject, and the len property.
Utility - clone, item, reverse, call, match, and the advanced assert / assertElse runtime casts.
To get a value's type name, use the
typeof(value)function. Theresultandoptiontypes have their own methods (isOk,unwrap, …) documented with their packages.
Last updated