Skip to content

Instantly share code, notes, and snippets.

@archiechen
Created November 5, 2012 03:54
Show Gist options
  • Save archiechen/4015229 to your computer and use it in GitHub Desktop.
Save archiechen/4015229 to your computer and use it in GitHub Desktop.
how to create javascript objects
var assert = require('assert')
describe('object', function() {
it('{}', function() {
var obj = {
name: 'obj',
des: 'des'
};
assert.equal('obj', obj.name);
assert.equal('des', obj.des);
});
it('Object', function() {
var obj2 = new Object();
obj2.name = 'obj2';
obj2.des = 'des';
assert.equal('obj2', obj2.name);
assert.equal('des', obj2.des);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment