What if you want to make a dictionary?
you = {'are': 'screwed'}
you = {'are': 'screwed'}
[0] https://leanpub.com/underhandedjavascript or its alternate title: https://leanpub.com/jsinterviewquestions [1] Slide 21 (1-index): https://speakerdeck.com/chewxy/underhanded-javascript-how-to...
EDIT:
For those of you who do not want to click through my self promotional links, try this in your browser:
{}[0] == true // false
{}[1] == true // true
!{}[0] == true // true
!{}[1] == true // trueBecause as soon as you see this
{ identifier:
You know it's an object literal and not a block. if foo == bar {
baz(), lorem(), ipsum()
}
could be: if foo == bar:
baz(), lorem(), ipsum()
or: if foo == bar:
{baz(), lorem(), ipsum()}
Admittedly, this code doesn't have a functional difference. With a bit more thought, I may be able to come up with code where that matters.This is doable since dictionaries and blocks show up in different contexts. A block never follows =,:, ;, or (, so with a context sensitive grammar this can be accomplished. I guess it depends how they intend to support anonymous functions (def{}?)