Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejavascript
themeConfluence
{"bar" : {10:"I like cheese"}}

get(path)

Returns the value at the given hash-path. This is the same as the foo{path}

Code Block
languagejavascript
themeConfluence
a = {
  "colors" : "many",
  "pi" : [3,1,4,1,5,6,9],
  "foo" : {"bar" : {10:"I like cheese"}}
};

a.get(["foo", "bar", "10"])
// "I like cheese"

a{["foo", "bar", "10"]}
// "I like cheese"

delete()

The delete() operator takes a hash path argument designating the member of the original data structure that should be deleted. The delete() operator returns a new data structure with the specified member deleted. If the path is invalid, nothing is deleted and the new data structure is identical to the original. For example:

...