I'm sure this has been asked but I'm not sure what to search. Say I have the following code:
const foo = {
apple: buffer.read(),
banana: buffer.read(),
carrot: buffer.read()
};
Is it guaranteed that the apple
key will be initialized first, followed by the banana key, and then lastly the carrot key? It matters because the buffer read
function internally increments the byte offset for later reading.
If it is not guaranteed I assume I would have to do this instead:
const apple = buffer.read();
const banana = buffer.read();
const carrot = buffer.read();
return { apple, banana, carrot };
But it would be nice if the first one always worked. I'm just not sure if it does.