Upgrade to Pro — share decks privately, control downloads, hide ads and more …

What’s to come for JavaScript?

What’s to come for JavaScript?

JavaScript is evolving faster than ever and there are a range of proposals currently making their way through the standardization process. In this talk, we’ll take a look at what’s to come and how it can help us write cleaner code in the future.

Avatar for Jakob Krigovsky

Jakob Krigovsky

January 31, 2018
Tweet

More Decks by Jakob Krigovsky

Other Decks in Programming

Transcript

  1. do expressions let color
 
 if (x === 0) {


    color = 'green'
 } else if (isEven(x)) {
 color = 'black'
 } else {
 color = 'red'
 }
  2. do expressions const color = do {
 if (x ===

    0) {
 'green'
 } else if (isEven(x)) {
 'black'
 } else {
 'red'
 }
 }
  3. do expressions <div>
 {do {
 if (color === 'green') {


    <GreenComponent />
 } else if (color === 'black') {
 <BlackComponent />
 } else {
 <RedComponent />
 }
 }}
 </div>
  4. Partial Application const add = (augend, addend) => augend +

    addend
 const addOne = …
 
 addOne(2) // => 3
  5. Partial Application const add = (augend, addend) => augend +

    addend
 const addOne = add(1, ?)
 
 addOne(2) // => 3
  6. Partial Application const message = "hello"
 |> repeat
 |> capitalize


    |> exclaim
 |> emojify(?, 'wave') "Hello, hello! !"
  7. Recap Optional Chaining Nullish Coalescing do expressions Pipeline Operator Partial

    Application user.address?.street user.settings.showIntro ?? true const color = do { … } "hello" |> repeat |> capitalize const addOne = add(1, ?)