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 FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn