mirror of
https://github.com/robertkrimen/otto
synced 2025-10-12 20:27:30 +08:00
Merge pull request #211 from yohanbelleguic/fix-example
readme: fix "twoPlus" example function
This commit is contained in:
commit
d5ddea59ff
|
@ -88,7 +88,7 @@ Set a Go function that returns something useful
|
|||
```go
|
||||
vm.Set("twoPlus", func(call otto.FunctionCall) otto.Value {
|
||||
right, _ := call.Argument(0).ToInteger()
|
||||
return, _ := vm.ToValue(2 + right)
|
||||
result, _ := vm.ToValue(2 + right)
|
||||
return result
|
||||
})
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue
Block a user