Targeting JavaScript with Kotlin

You may be wondering why anyone would want to write Kotlin code that is then transpiled to Kotlin? Why go through the extra work? What are the benefits? These are perfectly reasonable questions, and ultimately, will depend a lot on your own experience and needs. However, we can explore some of the benefits to help inform your own investigation and decisions.

One benefit of using Kotlin for JavaScript is that it's statically typed. Many developers find JavaScript's lack of static typing to be disorienting and something to be desired. As such, there have been new languages that pop up, such as TypeScript, that aim to bring static typing to the JavaScript world. In this sense, Kotlin is similar to TypeScript. ...

Get Mastering Kotlin now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.