scala vs. js => round 1
First post in a series showing how to accomplish the same task in JS and Scala.
Here we will show a little functional style programming using closures.
Task: write a function that takes an Int as an argument, and returns a function. The returned function also takes an Int as an argument and returns the sum of the two ints
Now with Scala:
We can closely approximate the Scala Syntax using JavaScript’s arrow functions from the ES6 version of the language: