Literal Notations

A little something from my forthcoming book "Object-Oriented JavaScript" I thought would be nice to share.

Literal Notations
name literal constructor example
object {} new Object() {prop: 1}
array [] new Array() [1,2,3,'test']
regular expression
/pattern/modifiers new RegExp('pattern', 'modifiers') /java.*/img

Tags: , ,

2 Responses to “Literal Notations”

  1. Altagracia Priebe Says:

    85% of the world wouldn’t know one from another. Sad, isn’t it.

  2. china 20 pollici Says:

    great blog!

Leave a Reply