It is certainly similar, and was done for a similar reason.
However the Perl version had better cause to do it (there is popular code in the wild which conflicts with Perl 5.10 features, whereas worries about functions named "let" are more theoretical), and did it with a language mechanism that is used by a lot of third party modules.
But there are other significant differences. The JavaScript version has horrible action at a distance. If my library uses let, you have to know that when you load it in a different file. How to do it is not obvious. If I have multiple JavaScript snippets, I have to include that feature in each one. If I wish to inline some JavaScript in a tag, there is (as far as I know) absolutely no way for me to say that I want features turned on. (Yes, in autogenerated code it sometimes does make sense to put complex JavaScript in tags.) Furthermore if I'm a novice bitten by JavaScript's unusual scoping rule, there is no easy way for me to discover that workaround.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|