val
for constant values (maybeconst
?)
-
Function definition with
fn
keyword instead offunction
(maybedef
?) -
Anonymous function definition with
=>
notationE.g.:
(a, b) => { return a * b; }
-
Error on using undefined variables
-
Error on defining variables without modifier
-
==
will always become===
-
if (a == undefined) // ...
will translate toif (typeof a === 'undefined') // ...
-
Number literals may also contain
_
characters to separate blocks for better readability.E.g.:
val a = 0x1000_0011
-
Mandatory semicolons after every expression
But in general: keep it simple! JavaScript doesn't have to change that much to become much simpler.