Multiway Partitioning Using Javascript

I am trying to understand how to write a multiway number partitioning algorithm that will take the sum of a given array and split it into fixed number of subsets such that the sum of the subsets are as similar as possible.

let num_list = [10,5,20,100,30,30,20,10]
let num_list_sum = 225
let n = 2
let equal_parts_array = []
let equal_parts = equal_parts_array.push(num_list_sum / n)
equal_parts = [112,113]


Example of Possible Results Should Be Such: [30,30,20,10,20], [10,5,100]