2021-10-17 17:34:55 +02:00
|
|
|
***
|
|
|
|
|
|
|
|
## title: getAsArray()
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
```js
|
|
|
|
array attributes.getAsArray(string key)
|
|
|
|
```
|
|
|
|
|
|
|
|
Will return an array with the value of attribute stored under `key`, or `false` if it's not set.
|
|
|
|
|
|
|
|
```js
|
|
|
|
let { Path, paths } = part.shorthand();
|
|
|
|
|
|
|
|
paths.demo = new Path()
|
|
|
|
.attr('class', 'classA')
|
|
|
|
.attr('class', 'classB');
|
|
|
|
|
|
|
|
let class = paths.demo.attributes.getAsArray('class');
|
|
|
|
// class now holds: ["classA", "classB"]
|
|
|
|
```
|