docs: vfmt the function example too (fix ci)
parent
e5c9fcb7e9
commit
231182c3ff
|
@ -1683,9 +1683,12 @@ fn main() {
|
||||||
})
|
})
|
||||||
// You can even have an array/map of functions:
|
// You can even have an array/map of functions:
|
||||||
fns := [sqr, cube]
|
fns := [sqr, cube]
|
||||||
println(fns[0](10)) // "100"
|
println((10)) // "100"
|
||||||
fns_map := { 'sqr': sqr, 'cube': cube}
|
fns_map := {
|
||||||
println(fns_map['cube'](2)) // "8"
|
'sqr': sqr
|
||||||
|
'cube': cube
|
||||||
|
}
|
||||||
|
println((2)) // "8"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue