// weakly typed variant const keypath_to_noice_parent = ["kill", "your", "self", 2, 1], // note: adding `as const` will not make it strongly typed because of a limitation/bug in `KeyPathsOf` noice_parent = getKeyPath(data, keypath_to_noice_parent) // type: `unknown`
assertEquals(noice_parent, { noice:"YAHAHA", 0:"you found me!" })
get value of nested
obj
at a givenkey-path
.Example