Answers for "js dictionary values"

CSS
17

dictionary in javascript

// Dictionaries are placed in braces, and values are seperated with a comma
let myDictionary = {
	"value 1": "string",
  	"value 2": 2,
	"value 3": ["array value 1", "array value 2"]
};

// Access the dictionary using its keys
var value1 = myDictionary["value1"]; // Type: String
var value2 = myDictionary["value2"]; // Type: Int
var value3 = myDictionary["value3"]; // Type: Array
Posted by: Guest on October-18-2020
2

js get all values of object

Object.values(object1)
Posted by: Guest on February-21-2020

Code answers related to "js dictionary values"

Browse Popular Code Answers by Language