apexDataArray getting toJSON() error

have this code, trying to look at an incoming parameter in a component method:

debug('this.links', this.links.toJSON());

and getting an error:

vendor.7d65a566181bebb0.js:130731 ERROR TypeError: this.links.toJSON is not a function
    at AddBlogPostCategoryLinkComponent.initialize (main.043c65607b603bad.js:39811:31)
    at AddBlogPostCategoryLinkComponent.ngOnInit (main.043c65607b603bad.js:39805:10)
    at callHookInternal (vendor.7d65a566181bebb0.js:129357:10)
    at callHook (vendor.7d65a566181bebb0.js:129381:7)
    at callHooks (vendor.7d65a566181bebb0.js:129341:9)
    at executeInitAndCheckHooks (vendor.7d65a566181bebb0.js:129296:5)
    at selectIndexInternal (vendor.7d65a566181bebb0.js:135113:9)
    at Module.ɵɵadvance (vendor.7d65a566181bebb0.js:135097:3)
    at ManageBlogPostComponent_apex_flex_column_1_Template (main.043c65607b603bad.js:75199:60)
    at executeTemplate (vendor.7d65a566181bebb0.js:135338:5)

but when I check interactively in the method code, toJSON does show up as a valid method against links. Is there a syntax I’m missing?

it’s strange, because the parent component to the one throwing the error has the exact same code (it gets the same input parameter that’s passed to the second component), and it works fine with the same syntax

If you are trying to output the form array in debug, you don’t need the .toJSON(). If you are trying to get the raw data inside the array for some other purpose, do this.links.formArray.value. That gets the current value of the form array and all its contents. It will not include any disabled fields. If you need disabled fields do this.links.formArray.getRawValue().

Thanks. I found it, it was an error in how I passing the ‘links’ parameter, had ‘is’ instead of ‘is evaluated from’ so it was treating it as a string and the toJSON wasn’t applicable.