Dict js

Príklady kódu

13
0

N

// 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
6
0

N

var test_dictionary = {
	"This is a key" : "This is the value of this key",
  	"You can make many keys" : {
    	// You can even nest dictionaries in one another
      	"Integer" : 123,
      	"String" : "Hello, world!",
      	"Boolean" : true,
      	"Array" : [1,2,3,4,5]
    }
}
2
0

N

var dict = {
  FirstName: "Chris",
  "one": 1,
  1: "some value"
};
1
0

N

// Get keys of a dictionary
let dict = { a:1 , b:2 , c:3 }

console.log( Object.keys(dict) ) // expected output : ['a', 'b', 'c']

V iných jazykoch

Táto stránka je v iných jazykoch

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................