Or are they virtually the same? Is it better to use one or the other if I know I only need 2 pieces of information for a function?
const twoKeyValPairs = {a:1, b:2};
vs
const a = 1;
const b = 2;
Or are they virtually the same? Is it better to use one or the other if I know I only need 2 pieces of information for a function?
const twoKeyValPairs = {a:1, b:2};
vs
const a = 1;
const b = 2;
All global variable, itself created inside an global object (window). Accessing a function variable is fast as compared to accessing key from object. You can read more from below link.