Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (21 sloc) 468 Bytes
<!doctype html>
<html lang="en">
<head>
<title>JavaScript Patterns</title>
<meta charset="utf-8">
</head>
<body>
<script>
/* Title: Object literal
* Description: use the simpler and reliable object literal instead of new Object();
*/
// antipattern
var car = new Object();
car.goes = "far";
// preferred
var car = {goes:"far"};
// References
// http://shop.oreilly.com/product/9780596806767.do
</script>
</body>
</html>