rse / es6-features

ECMAScript 6: Feature Overview & Comparison

Home Page: https://rse.github.io/es6-features/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Block-Scoped Constants ES5 code is wrong.

webbedspace opened this issue · comments

commented

This is not comparable to const: you can still re-bind the PI variable to something else, e.g. PI = 7;. Really, ES5 has no equivalent.

I've tried a rough ES5 equivalent again: this time with defineProperty. Thanks for the hint.