Versions Compared

Key

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

...

DescriptionThis function returns an object composed from key-value pairs that accepts two arrays, the first with the properties and the second with values. This works similar to the Lodash zipObject function.
Syntax


Code Block
sl.zipObject([props=[]], [values=[]])


Info

You can also use field parameters if they contain arrays of the different lengths, but extra key values are set to null.


Examples

Expression: sl.zipObject([1, 2], ['a', 'b'])

Result:

Code Block
{a'1': 1'a', b'2': 2'b'}


Expression: sl.zipObject ([1,2],['a'])

Result

Code Block
{'1': 'a', '2': null}


...