To use the set
function from the Lodash library in TypeScript, the following steps should be taken:
index.ts19 chars2 lines
set
function in your TypeScript file:index.ts59 chars3 lines
set
function as follows:index.ts116 chars4 lines
In the code block above, the first line contains an object object
with a nested property a[0].b.c
. The set
function is used to set the value of a[0].b.c
to 4. The last line is used to verify that the value of a[0].b.c
has indeed been changed to 4.
gistlibby LogSnag