can-define
Version:
Create observable objects with JS dot operator compatibility
24 lines (15 loc) • 684 B
Markdown
can-define/list/list.prototype.serialize serialize
can-define/list/list.prototype
Returns the a serialized version of this list.
`list.serialize()`
Goes through each item in the list and gets its serialized
value and returns them in a plain Array.
Each items serialized value is the result of calling [can-reflect.serialize canReflect.serialize()] on the item.
```js
import {DefineList} from "can";
const list = new DefineList(["first", {foo: "bar"}]);
const serializedList = list.serialize();
console.log(serializedList); //-> ["first", {foo: "bar"}]
```
{Array} An array with each item's serialized value.