Last active
July 3, 2016 06:46
-
-
Save mjzone/eb77965bc2bd866c2e4739ca84179937 to your computer and use it in GitHub Desktop.
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 person = new Object(); | |
person.name = 'Manoj'; | |
console.log(person) //Result: Object {name: "Manoj"} | |
var ages = new Array(10); | |
console.log(ages) // Result: [,,,,,,,,,,] gotcha! | |
// Always use JSON format. | |
var person = { | |
name: 'Manoj' | |
} | |
console.log(person) //Result: Object {name: "Manoj"} (This calls new behind the scene and return new object) | |
var ages = [10]; | |
console.log(ages)//Result: [10] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment