FCF 2.0 development in progress...
> > > >
[News] [Packages API] [Downloads] [Donate to the project] [Contacts]

fcf.resolve() function

mixed fcf.resolve(object a_obj, string|[string] a_path, boolean a_quiet = true)

Package: fcf-framework-core

File: fcf-framework-core:fcf.js

Available from version: 2.0.2

Returns a subfield of the object at the specified path

Arguments

object a_obj
- The object from which the subfield will be selected

string|[string] a_path
- The path to the subfield to extract. See the path format in the description of the function fcf.parseObjectAddress

boolean a_quiet = true
- If true, then if getting a subfield is performed on a non-object field, undefined is returned

If set to false, then if a subfield is retrieved on a field that is not an object, an exception is thrown with the code ACCESS_FAILED_FIELD_TOKENIZE,

Result
mixed
- The value of the found subfield

Example: Function application

{ let object = { field1: { field2: "value", } } let value = fcf.resolve(object, "field1.field2"); console.log(value); }

Output:

value