I do not understand the placement of new things with the spread operator. The expected behavior was the new object key and value would be added to the end of the object, but instead it was inserted in the second to last spot. Can anyone tell me why? Code posted below
I see now that it automatically put it into alphabetical order according to the keys. I still do not understand why it does this. Is there a way to return it in the original order and to ensure something is added to END?
Thank you for your reply, I see where I confused myself. Since the object was a bit too large for my screen it did not show the rest of the object, so when I expanded it in the console that is where it went into alphabetical order, not in the actual output of the new object. Thanks again for verifying that it works as expected