Object and Array literal in JavaScript

This post is mostly for my own reference as I seem to keep messing this up. :O

The basics

{} is an object literal

//this creates a new object
a = {};
//so does this
a = new Object();


[] is an array literal

//this creates a new array
a = [];
//so does this
a = new Array();


properties can be accessed via . and [] notation:

//these are the same
a.b = c;
a['b'] = c;


Object literals can be set using literal values or strings:

a = {
    //any character you can use for a variable name can be
    //used to instantiate an object without quotes
    b: c,
    //special characters need to be quoted
    "foo bar baz": "fizz buzz"



Yeoman generators

Updated May 19 2013

Just → npm search yeoman-generator for my own reference

NAME                  DESCRIPTION
calaxa                calaxa ======
ft-wp                 Front-Trends WordPress generator
generator-angular     Yeoman generator for AngularJS
generator-angular-silex Yeoman generator for Silex based upon AngularJS
generator-assemble    Yeoman generator for Assemble
generator-aura        Yeoman generator for Aura.js
generator-backbone    Yeoman generator for Backbone.js
generator-backbone-amd generator-backbone-amd ======================
generator-barista     Yeoman generator for Barista
generator-bbb         Yeoman generator for Backbone Boilerplate
generator-bbproject   Yeoman Generator for BB Project
generator-boilerplate Yeoman Generator for ...
generator-bookmarklet Yeoman Generator for bookmarklets
generator-bootstrap   Yeoman generator for Twitter Bootstrap
generator-bootstrap-less Yeoman generator fo twitter bootstrap less
generator-breakpoint  A Yeoman generator for starting a project with Breakpoint
generator-btapp       BitTorrent btapp.js web app yeoman generator
generator-buster      generator-buster ================
generator-cagspa      A generator for Single Page Applications
generator-carlosypunto A generator for Yeoman. Generate simple require.js workfl
generator-charcoal    Alternative Yeoman generator for Ember
generator-chrome-extension Yeoman generator for Chrome Extensions
generator-chromeapp   Yeoman generator for Chrome App
generator-cityjs      Yeoman generator for CityJS
generator-closure     Generator for Closure Library
generator-component   A Yeoman generator for components.
generator-cucumber    Yeoman generator for Cucumber.js
generator-dotfiles    Get started with your projects quickly using this generato
generator-ember       Yeoman generator for Ember
generator-express     A nodejs express generator for Yeoman
generator-firefoxos   A Firefox OS app generator for Yeoman
generator-flask       Yeoman generator for Flask project
generator-footguard   Yeoman generator for single page application
generator-foundation  Yeoman generator for Stylus themes, especially zurb founda
generator-frontend    Scaffolds out a boilerplate for front-end development.
generator-generator   Generator Generator for Yeoman
generator-genesis     Yeoman Generator for Genesis Skeleton
generator-gpmd        Modified Yeoman generator for scaffolding out a front-end
generator-gumby       Yeoman generator for Gumby 2 Framework
generator-h5bp        HTML5 Boilerplate generator
generator-heroku      A heroku setup generator for Yeoman
generator-init        A generator for generating generators in Yeoman
generator-jasmine     Yeoman generator for Jasmine
generator-jquery-boilerplate Yeoman Generator for jQuery Boilerplate
generator-js-library  Yeoman Generator for client-side JS Libraries, w/ Karma Ru
generator-jsmodule    Generator for scaffolding out a JavaScript module for Node
generator-karma       Yeoman generator for Karma
generator-kissy-gallery kissy gallery generator
generator-kissy-pie   kissy generator for kissypie
generator-knockout    A generator for Yeoman
generator-lessapp     Edited default Yeoman generator for scaffolding out a fron
generator-maria       A generator for Yeoman
generator-mdpress     A generator for Yeoman to create mdpress presentations.
generator-microlib    A Yeoman generator for browser microlibs
generator-mobile-boilerplate H5BP Mobile Boilerplate generator
generator-mocha       Yeoman generator for Mocha
generator-nodeapp     A yeoman generator for a BDD node js application
generator-nodestrap   Yeoman generator for a Heroku-ready, coffee-fueled web sta
generator-ozjs        Scaffolding tool for OzJS which offers a packaging workflo
generator-pugpig      Yeoman Generator for Pugpig
generator-requirejs   A generator for Yeoman
generator-sails       A Yeoman sails generator largley copied from generator-web
generator-server-configs Scaffolds out webserver configuration for various platf
generator-sharepoint  Yeoman generator for scaffolding out SharePoint grunt buil
generator-silex       Yeoman generator for scaffolding out a silex app
generator-skeleton    Yeoman generator for Skeleton
generator-sp2010      Yeoman generator for projects using the SharePoint 2010 RE
generator-spboilerplate Yeoman Generator for rwd site with sharepoint boilerplat
generator-static      Yeoman Generator for a basic front-end project workflow
generator-testacular  Yeoman generator for Testacular
generator-topcoat     A Topcoat generator for Yeoman
generator-travis-ci   Yeoman generator that sets up travis-ci to do automated de
generator-ultimate    ULTIMATE Yeoman generator for ultimate-seed - the ultimate
generator-webapp      Default Yeoman generator for scaffolding out a front-end w
generator-wordpress   A Yeoman generator for WordPress
generator-yaml4       Yeoman generator YAML4-Sass
generator-yo-wordpress Yeoman generator for WordPress project
generator-yui         A YUI generator for Yeoman
generator-zurb-foundation Yeoman generator for Zurb Foundation 4
imatic-stack          Imatic devel stack for single-page applications
yeoman-generator      Rails-inspired generator system that provides scaffolding



TypeScript, JavaScript, and Dart

Very intresting talk about JavaScript with two smart guys behind TypeScript and Dart. First I thought these two new languages are the same thing. Meaning, TypeScript is a copy of Dart but actually they are quite different.

Quoting Scott Hanselman:

People have compared TypeScript to Dart. That’s comparing apples to carburetors. TypeScript builds on JavaScript so there’s no JS interop issues. Dart is a native virtual machine written from scratch. Dart interops with JavaScript…but it’s not JS. It doesn’t even use the JavaScript number type for example.

From Why does TypeScript have be the answer to anything?

jQuery IntelliSense support in VS

I was hoping that it would happen but I never believed that Microsoft would involved themselves in OpenSource library. But luckily I was wrong. ScottGu writes:

I’m excited today to announce that Microsoft will be shipping jQuery with Visual Studio going forward.  We will distribute the jQuery JavaScript library as-is, and will not be forking or changing the source from the main jQuery branch.  The files will continue to use and ship under the existing jQuery MIT license.

It seems that Microsoft is really starting to turn their ship towards Open Source, it is great to see that they did choose best technology for developers.

Atlas will be Microsoft AJAX Library

This is pretty obvious but I am going to make post anyway since I need to start to fork yet another JavaScript library. Atlas Javascript Library will be renamed to Microsoft AJAX Library and server-side stuff ASP.NET 2.0 AJAX Extensions.
From Ajaxian


Scott Guthrie has announced the “Atlas” 1.0 Naming and Roadmap, which includes the news that Atlas 1.0 will ship around the end of this year, that it will become “fully supported” by Microsoft.