Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

    { // start block statement
      a: // labeled statement [1]
      1  // expression statement
    } // end block statement
    [ // start array literal
      “a” // string value
    ] // end array literal

vs.

    ( // start expression statement
      { // start object literal
        a: // object literal key
        1  // expression statement
      } // end object literal statement
      [ // begin subscript property access
          “a” // string (property key)
      ] // end subscript property access
    ) // end expression
[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... versus

Edit: fixed second example (it did not match the parent comment), changed some verbiage



Very helpful!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: