Created
November 5, 2012 03:54
-
-
Save archiechen/4015229 to your computer and use it in GitHub Desktop.
how to create javascript objects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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