Nav

divideBy

divideBy(Object, Number): Array<Object>

Divides the object into sub-objects with the specified number of properties.

Transform

        
     
1
2
3
4
%dw 2.0
import divideBy from dw::core::Objects
---
 {a: 123,b: true, a:123, b:false} divideBy 2
Output

        
     
1
2
3
4
5
6
7
8
9
10
[
   {
     "a": 123,
     "b": true
   },
   {
     "a": 123,
     "b": false
   }
 ]