The object to modify.
Optional
value: anyThe value to set.
Optional
Optional
customizer: ((...any) => any)The function to customize assigned values.
Optional
Rest
...any: any[]Rest
Returns object
.
5.3.0
const object = {}
setWith(object, '[0][1]', 'a', Object)
// => { '0': { '1': 'a' } }
This method is like
set
except that it acceptscustomizer
which is invoked to produce the objects ofpath
. Ifcustomizer
returnsundefined
path creation is handled by the method instead. Thecustomizer
is invoked with three arguments: (nsValue, key, nsObject).Note: This method mutates
object
.