---
lang: en
title: 'API docs: metadata.decoratorfactory.getnumberofparameters'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/metadata
permalink: /doc/en/lb4/apidocs.metadata.decoratorfactory.getnumberofparameters.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/metadata](./metadata.md) &gt; [DecoratorFactory](./metadata.decoratorfactory.md) &gt; [getNumberOfParameters](./metadata.decoratorfactory.getnumberofparameters.md)

## DecoratorFactory.getNumberOfParameters() method

Get the number of parameters for a given constructor or method

**Signature:**

```typescript
static getNumberOfParameters(target: Object, member?: string): number;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

target


</td><td>

Object


</td><td>

Class or the prototype


</td></tr>
<tr><td>

member


</td><td>

string


</td><td>

_(Optional)_ Method name


</td></tr>
</tbody></table>

**Returns:**

number


