Scala.js for JavaScript developers

Below you can see the same functionality implemented in JavaScript ES6 and Scala.js. See any differences?

var xhr = new XMLHttpRequest();"GET",
  "" +
xhr.onload = (e) => {
  if (xhr.status === 200) {
    var r = JSON.parse(xhr.responseText);
val xhr = new XMLHttpRequest()"GET",
  "" +
xhr.onload = { (e: Event) =>
  if (xhr.status == 200) {
    val r = JSON.parse(xhr.responseText)

Even though Scala language comes from a very different background than JavaScript, typical Scala code is quite understandable for JavaScript developers. This section will walk you through the differences and show you how to write basic Scala code. If you have fallen in love with the new features in ES6 like arrow functions or destructuring, you can find them all in Scala as well!

The walk-through has been split into three parts:

Each part has a lot of code examples comparing ES6 code to corresponding Scala code.

You may also find some of the presentation videos a nice way to familiarize yourself with Scala.