I have an array containing 4 values. I need to make it a nested array with two arrays containing two values. Javascript is needed. This answer could help but it is in Ruby. Array reduce may help but I am not able to use it well enough.
array = [20, 45, 22, 51]
result = [[20,45],[22,51]]