Closed
Description
package main
import (
"github.com/gopherjs/gopherjs/js"
)
func main() {
var MyStringValue string
MyStringValue = "MyStringValue1"
js.Global.Set("MyStringValue", MyStringValue)
println(js.Global.Get("MyStringValue")) // passed - MyStringValue1
MyStringValue = "MyStringValue2"
println(js.Global.Get("MyStringValue")) // passed - MyStringValue1
MyStringPointer := &MyStringValue
*MyStringPointer = "MyStringValue3"
println(js.Global.Get("MyStringValue")) // failed - expected MyStringValue3, got MyStringValue1
*MyStringPointer = "MyStringValue4"
js.Global.Set("MyStringValue", MyStringPointer)
println(js.Global.Get("MyStringValue")) // failed - expected MyStringValue4, got Object{}
}
Metadata
Metadata
Assignees
Labels
No labels