3 Functions and Tables

In this chapter, we explore functions in WebAssembly: how and when we should import functions from JavaScript or a different WebAssembly module and how to export WebAssembly functions to the embedding environment and call those functions from JavaScript. You’ll learn about tables in WebAssembly and how to call functions defined in tables. We also examine the performance implications of calling functions that we define inside and outside of the WebAssembly module.

A WebAssembly module interacts with the embedding environment using imported and exported functions. We must import functions from the embedding environment ...

Get The Art of WebAssembly now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.