javascript array dictionary code example
Example 1: dictionary in javascript
let myDictionary = {
"value 1": "string",
"value 2": 2,
"value 3": ["array value 1", "array value 2"]
};
var value1 = myDictionary["value1"];
var value2 = myDictionary["value2"];
var value3 = myDictionary["value3"];
Example 2: react dictionary key value avec 2 variable
var dictionary = {};
dictionary["key1"] = value1;
var key1 = dictionary["key1"];
Example 3: javascript add to a dictionary
obj["key3"] = "value3";
Example 4: js dictionary
var dict = {
FirstName: "Chris",
"one": 1,
1: "some value"
};