You don't need to be a language guru to know which operation will be
performed first, you can (and should) check an operator precedence and
associativity table such as MDN's
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence>
.
Knowing operator precedence and associativity is very important when
reading code written by others, and many projects use the "no unnecessary
parens" linting rule.

/fm

On Thu, Aug 27, 2015 at 8:35 AM, Bill Frantz <fra...@pwpconsult.com> wrote:

> On 8/27/15 at 11:51 PM, niloy.monda...@gmail.com (Niloy Mondal) wrote:
>
> x ** y ** z is easier to read/write than x.pow(y.pow(z))
>>
>
> As a language guru, you know which operation will be performed first. As
> Joe programmer, I don't and I would need to write it as x ** (y ** z).
>
> With some operations, like +, the order doesn't matter and x + y + z is
> not confusing.
>
> Cheers - Bill
>
> ---------------------------------------------------------------------------
> Bill Frantz        |"We used to quip that "password" is the most common
> 408-356-8506       | password. Now it's 'password1.' Who said users
> haven't
> www.pwpconsult.com | learned anything about security?" -- Bruce Schneier
>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to