In the JavaScript code, I’ve:
request.onsuccess = function(event) {
var cursor = event.target.result;
if(cursor){ }
}
In my equivalent GO code, I wrote:
ReadAll = js.FuncOf(func(this js.Value, args []js.Value) interface{} {
defer ReadAll.Release()
cursor := this.Get("result")
if cursor { }
}
But while compiling, I got:
non-bool cursor (type js.Value) used as if condition
Ho can I check if the related js.value
exists or no?