update builtin function documentation (#159)
* Update builtins.md * Update builtins.md * Update builtins.md
This commit is contained in:
parent
7e3f3f809e
commit
2b21c29bd3
1 changed files with 36 additions and 8 deletions
|
@ -31,14 +31,6 @@ v := [1]
|
||||||
v = append(v, 2, 3) // v == [1, 2, 3]
|
v = append(v, 2, 3) // v == [1, 2, 3]
|
||||||
```
|
```
|
||||||
|
|
||||||
## string
|
|
||||||
|
|
||||||
Tries to convert an object to string object. See [Runtime Types](https://github.com/d5/tengo/blob/master/docs/runtime-types.md) for more details on type conversion.
|
|
||||||
|
|
||||||
```golang
|
|
||||||
x := string(123) // v == "123"
|
|
||||||
```
|
|
||||||
|
|
||||||
## type_name
|
## type_name
|
||||||
|
|
||||||
Returns the type_name of an object.
|
Returns the type_name of an object.
|
||||||
|
@ -57,6 +49,14 @@ v = string(undefined, "foo") // v == "foo"
|
||||||
v = string(undefined, false) // v == false
|
v = string(undefined, false) // v == false
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## string
|
||||||
|
|
||||||
|
Tries to convert an object to string object. See [Runtime Types](https://github.com/d5/tengo/blob/master/docs/runtime-types.md) for more details on type conversion.
|
||||||
|
|
||||||
|
```golang
|
||||||
|
x := string(123) // v == "123"
|
||||||
|
```
|
||||||
|
|
||||||
## int
|
## int
|
||||||
|
|
||||||
Tries to convert an object to int object. See [this](https://github.com/d5/tengo/blob/master/docs/runtime-types.md) for more details on type conversion.
|
Tries to convert an object to int object. See [this](https://github.com/d5/tengo/blob/master/docs/runtime-types.md) for more details on type conversion.
|
||||||
|
@ -131,6 +131,14 @@ If you pass an int to `bytes()` function, it will create a new byte object with
|
||||||
v := bytes(100)
|
v := bytes(100)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## time
|
||||||
|
|
||||||
|
Tries to convert an object to time value.
|
||||||
|
|
||||||
|
```golang
|
||||||
|
v := time(1257894000) // 2009-11-10 23:00:00 +0000 UTC
|
||||||
|
```
|
||||||
|
|
||||||
## is_string
|
## is_string
|
||||||
|
|
||||||
Returns `true` if the object's type is string. Or it returns `false`.
|
Returns `true` if the object's type is string. Or it returns `false`.
|
||||||
|
@ -170,3 +178,23 @@ Returns `true` if the object's type is function or closure. Or it returns `false
|
||||||
## is_callable
|
## is_callable
|
||||||
|
|
||||||
Returns `true` if the object is callable (e.g. function, closure, builtin function, or user-provided callable objects). Or it returns `false`.
|
Returns `true` if the object is callable (e.g. function, closure, builtin function, or user-provided callable objects). Or it returns `false`.
|
||||||
|
|
||||||
|
## is_array
|
||||||
|
|
||||||
|
Returns `true` if the object's type is array. Or it returns `false`.
|
||||||
|
|
||||||
|
## is_immutable_array
|
||||||
|
|
||||||
|
Returns `true` if the object's type is immutable array. Or it returns `false`.
|
||||||
|
|
||||||
|
## is_map
|
||||||
|
|
||||||
|
Returns `true` if the object's type is map. Or it returns `false`.
|
||||||
|
|
||||||
|
## is_immutable_map
|
||||||
|
|
||||||
|
Returns `true` if the object's type is immutable map. Or it returns `false`.
|
||||||
|
|
||||||
|
## is_time
|
||||||
|
|
||||||
|
Returns `true` if the object's type is time. Or it returns `false`.
|
||||||
|
|
Loading…
Reference in a new issue