Storing an object key/value in an array but not in an array element [duplicate]

I found some odd things and am looking for explanations as to how and why

let a = [] ;
a.push({foo:"bar",bar:"foo"}] ;
console.log(a) ;

As expected, prints out:

[[object Object] {
  bar: "foo",
  foo: "bar"
}]

however, I accidentally found I could also do this:

a.someKey = "someValue" ;  // this does NOT throw an error
console.log(a) ;

prints out, no reference to ‘someKey’ is in the print out

[[object Object] {
  bar: "foo",
  foo: "bar"
}]

console.log(a.someKey) ;
   

Prints out someValue

How am I able to assign an object key/value in an array but outside the scope of the array list? And when I print out a, why does it ONLY show the array and not the object key/value?

Contrarily, I also found I can do this too:

var b = {} ; 
b.this = "that" ;
b.that = "this" ;
b[0] = { more:"foo",less:"bar"} ; 
console.log(b) ;

Prints out:

[object Object] {
  0: [object Object] {
    less: "bar",
    more: "foo"
  },
  that: "this",
  this: "that"
}

So, you can store object key/values outside the scope of the array list and you can store an array list inside of an object that is referenced as a normal array.

Can someone help me understand this?