[技術討論] JavaScript => ES6

有冇 frontend / backend development project 已經用緊 ES6?

感覺如何? 覺得難唔難用/學?

Seems like every project will need to be written in ES6 (or even in ES7) in 2016... Especially those popular frontend package

e.g. AngularJS / ReactJS

babel, try babel

TOP

回覆 2# chi251155


用開coffeescript個syntax, 一下子好難適應, 因為要不停咁declare番d var, let,function 咁。

Ching 除左bebel 之外仲有冇用d乜lib / package?

學緊用flux architecture,幾好咁。原來喺front end 唔一定要做MVC M**C....

TOP

回覆 3# lancon


    其實我少用ES6,多數都係syntax sugar。我多數後面剩用node,前面用angular同jquery,用左JS咁耐,好多ES6功能我都polyfill左

TOP

我用得最多都係 ES6 Promise 既polyfill..其他就唔知...

我眼見d新tutorial d article 全部都ES6, 突然覺得仲用ES5/coffeescript 好似好 outdate...

TOP

寫Backend ES6 + Node js  靚 structure 已經差好遠

TOP

回覆 6# hihihi123hk


nodejs (4.2.0)好似未完全用哂ES6 d feature,都係要 babel 同 polyfill,不過到完全native support果陣應該會幾順

TOP

回覆 7# lancon


    哈哈,個人覺得 ES6 最最最正係
class 、 template string、arrow functions

識用呢三個, backend 嘅 javascript 會靚仔極多

TOP

回覆 8# hihihi123hk

十分同意,仲有import/export又係好方便,尤其frontend 唔使再理AMD 定 commonJS

不過class 呢樣野有d奇怪。始終JavaScript 係Function program + prototype inheritance 為主。加左d OOP既野上去,好似好累贅。

TOP

回覆 8# hihihi123hk


    反而寫落堆code用Prototype.member = function,而家先轉番哂都唔係咁易,不過ES5做inheritance真係超煩

TOP