Empty objects in javascript

What is the purpose of creating an empty object? For example this code has an empty object baz why? I dont understand the purpose of creating an empty object Im sure its simple concept. Thanks

var object = {
foo: 1,
“bar”: “some string”,
baz: {
}
};

1 Like

True, I agree with what Randy is saying. Some people may choose to make it null instead, but the your code would need to know how to handle that. Both are valid approaches.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.