I need to set all properties of some object to null. But the object can be very big, so I can\'t just do it one by one.
null
How to set all properties at onc
Another way of doing it, using Array.reduce. It does not overwriting the existing object. This only works if the object only have simple values.
Array.reduce
const newObj = Object.keys(originalObj).reduce( (accumulator, current) => { accumulator[current] = null; return accumulator }, {});