1
0
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:
Conrad Pankoff 2016-10-04 23:45:46 +11:00 committed by GitHub
commit d5ddea59ff

View File

@ -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
})
```