mirror of
https://github.com/lowdefy/lowdefy.git
synced 2025-02-17 14:30:34 +08:00
60 lines
1.5 KiB
YAML
60 lines
1.5 KiB
YAML
# Copyright 2020-2021 Lowdefy, Inc
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
_ref:
|
|
path: templates/operators.yaml.njk
|
|
transformer: templates/operatorsMethodTransformer.js
|
|
vars:
|
|
pageId: _product
|
|
pageTitle: _product
|
|
filePath: operators/_product.yaml
|
|
types: |
|
|
```
|
|
(values: any[]): number
|
|
```
|
|
description: |
|
|
The `_product` operator takes the product of the values given as input. If a value is not a number, the value is skipped.
|
|
arguments: |
|
|
###### array
|
|
An array of values to multiply.
|
|
examples: |
|
|
###### Two numbers:
|
|
```yaml
|
|
_product:
|
|
- 3
|
|
- 4
|
|
```
|
|
Returns: `12`
|
|
|
|
###### Array of numbers:
|
|
```yaml
|
|
_product:
|
|
- 1
|
|
- 2
|
|
- 3
|
|
- 4
|
|
```
|
|
Returns: `24`
|
|
|
|
###### Non-numbers are skipped:
|
|
```yaml
|
|
_product:
|
|
- 1
|
|
- null
|
|
- 3
|
|
- "four"
|
|
- 5
|
|
```
|
|
Returns: `15`
|