ecmascript2015

The new ECMAScript2015 brings a lot of new funcionality but there’s something that is not possible without doing a little workaround. Let’s see the code

class AwesomeClass {
  static get PI () {
    return 3.14159265359
  }
}

export default AwesomeClass

Now you can use the constant just like this

import AwesomeClass from 'awesome'

let piSquare = AwesomeClass.PI * AwesomeClass.PI
Comparte este articuloShare on Facebook
Facebook
Share on Google+
Google+
Tweet about this on Twitter
Twitter
Share on LinkedIn
Linkedin

Comentarios

comentarios