_.toPath

_.toPath(value)

Converts value to a property path array.

Since

4.0.0

Arguments

  1. value (*): The value to convert.

Returns

(Array): Returns the new property path array.

Example

1
2
3
4
5
_.toPath('a.b.c');
// => ['a', 'b', 'c']
  
_.toPath('a[0].b.c');
// => ['a', '0', 'b', 'c']
doc_Lodash
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.