Versions Compared

Key

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

...

Code Block
themeConfluence
languagejavascript
a = {"a" : 10, "b" : [1, 3, "hello"]};
b = a.encode() // b = "{'a' : 10, 'b' : [1, 3, 'hello']}";

The encode() operator takes an optional map as an argument containing options for encoding. 

optionvaluesdescription
prettytrue, falsepretty prints the encoding (newlines and indents) if true

filter()

The filter() operator takes a function as its only argument returns a map. The new map contains any members of the original map for which the function evaluates to true. The function given as the argument must take two arguments and return a Boolean value. The function is applied to the key and value of each member of the map in turn. The number of elements in the new map will be less than or equal to the length of the original map. For example:

...