Declaring objects in Javascript is easiest than other programming languages. For example in C# (or Java), first you must declare structure of object, then you create an instance of that.
using System;
namespace Example
{
public struct Person
{
public string Name;
public int Age;
public Person(string name, int age)
{
Name = name;
Age = age;
}
}
public class Application
{
static void Main()
{
Person p1 = new Person("John Doe", 60);
Console.WriteLine("p1 Name = {0} Age = {1}", p1.Name, p1.Age);
}
}
}
But in Javascript you can declare structure of object or not. Even you can modify that structure after declaring. That's amazing (maybe not). This feature of Javascript can produce many problems.
So, there is no difference. But if you declare the structure, code will be more cleaner.
For more information:
data, and makes the structure of the object immediately visible.