Damit lässt sich eine JSON-Definition in JavaScript direkt mit der eval()-Funktion in ein JavaScript-Objekt umsetzen.
This easy and popular but risky technique exploits JSON's compatibility with the JavaScript eval() function, which is described below.
Wenn mit der Funktion ein JSON-String zurückgegeben wird, kann dieser mit der Methode JSON.parse wieder in ein JavaScript-Objekt umgewandelt werden. Beispiel
If you returned a JSON string from the function, you could convert it back into a JavaScript object using JSON.parse method, e.g.
Es muss in ein natives JavaScript Objekt umgewandelt werden, wenn du auf die Daten zugreifen willst.
It needs to be converted to a native JavaScript object when you want to access the data.
Prüfen, ob ein Schlüssel in einem JavaScript-Objekt existiert?
Les exemples vous aident à traduire le mot ou l’expression cherchés dans des contextes variés. Ils ne sont ni sélectionnés ni validés par nous et peuvent contenir des mots ou des idées inappropriés. Signalez des exemples à modifier ou à retirer. Les traductions potentiellement sensibles, inappropriées ou familières sont généralement marquées de rouge ou d’orange.