March 2019
Beginner to intermediate
324 pages
7h 17m
English
Basic types are good; however, they are just a simple component of any real piece of code. What about Go structs, interfaces, methods, functions, and goroutines? The js package gives you the power to convert those types to JavaScript.
One of the key building blocks provided by the js package is the *js.Object type. This type is simply a container for a native JavaScript object. Most of GopherJS's code involves converting Go objects to *js.Object or vice versa. JavaScript modules are exposed as *js.Object in our Go code.
Now, let's explore how to call JavaScript functions from our Go code in the next section.
Read now
Unlock full access