I am curious if it is possible to assign a variables value to be a properties name in a Javascript object. For example, If I want to make objects where the key is a timestamp.
const timestamp = Date.now().toString();
const myObject = {
timestamp: {
data: "data value",
data2: 2,
. . .
}
};
and output being something like
1686151152733: { data: "data value", data2: 2, ... }