Literal Notations
A little something from my forthcoming book "Object-Oriented JavaScript" I thought would be nice to share.
| 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: book, literal notation, oojs
December 17th, 2011 at 1:38 pm
85% of the world wouldn’t know one from another. Sad, isn’t it.
January 3rd, 2012 at 2:47 pm
great blog!