// Initialize with array
let dict = {
key1: [value1, value2, value3]
};
// Add values later
dict.key1 = dict.key1 || []; // Create array if it doesn't exist
dict.key1.push(newValue);
// Example:
let users = {
"team1": ["Alice", "Bob"]
};
users.team1.push("Charlie"); // adds "Charlie" to team1
// Initialize with array
let dict = {
key1: [value1, value2, value3]
};
// Add values later
dict.key1 = dict.key1 || []; // Create array if it doesn't exist
dict.key1.push(newValue);
// Example:
let users = {
"team1": ["Alice", "Bob"]
};
users.team1.push("Charlie"); // adds "Charlie" to team1