Transpiling to JavaScript
The magic comes from the Kotlin compiler and your project target. In a standard JVM-targeted Kotlin project, the compiler generates JVM-compatible bytecode that runs on the JVM and is intrinsically compatible with other JVM code.
When creating a Kotlin project that targets JavaScript, all of the Kotlin code within that project will be transpiled to JavaScript when you build the project. If you're unfamiliar with the term transpile, it refers to the compilation of a programming language by converting it from one language to another. In a sense, the code is rewritten to match the target language. In this case, the Kotlin code you write is translated into compatible JavaScript that can then be consumed as if you had ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access