javascript - Lodash split object -


how can use lodash split following object 2 arrays

the object

{"m":   [    "alpha",    "beta",    "zeta"],  "f":     [      "alpha",      "omega"   ]} 

i want be

var first =  [    "alpha",    "beta",    "zeta"] // contents of m  var second =   [      "alpha",      "omega"   ] // contents of f 

is possible in lodash? , if not how possible in vanillajs

thanks

you don't need lodash this. just:

var first = theobject.m; var second = theobject.f; 

first , second refer arrays in object. if want copy them, then:

var first = theobject.m.slice(); var second = theobject.f.slice(); 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -