func NewObject(raw js.Value) (Object, error) {
	if raw.Type() != js.TypeObject {
		return Object{}, TypeMismatchError{
			Expected: js.TypeObject,
			Actual:   raw.Type(),
		}
	}
	return Object{raw}, nil
}
NewObject instantiates a new Object with the provided js.Value.
If the js.Value is not an Object, it returns a TypeMismatchError.
package wasm
import (
	"fmt"
	"syscall/js"
)
type TypeMismatchError struct {
	Expected js.Type
	Actual   js.Type
}
func (e TypeMismatchError) Error() string {
	return fmt.Sprintf("expected %v type, got %v type instead", e.Expected, e.Actual)
}
func Global() Object {
	global, err := NewObject(js.Global())
	if err != nil {
		panic(err)
	}
	return global
}
type Object struct {
	value js.Value
}