# success

```typescript
import { Result } from 'types-ddd';

return Result.success<T, F>();
```

> ### Result.ok
>
> &#x20;This one the argument is required, you always must provide a value to return&#x20;

> ### Result.success
>
> This one the argument is optional.&#x20;

## When to use It?

{% hint style="info" %}
When you have a function that return void
{% endhint %}

```typescript
import { Result } from 'types-ddd';

const SumLessThanTenAndPrintResult = (n1: number, n2: number): Result<void> => {

    const sumResult = n1 + n2;
    console.log(sumResult);
    
    if (sumResult >= 10) {
         return Result.fail("Result is greater than ten");
    }
    return Result.success();

}

const result = SumLessThanTenAndPrintResult(2, 3);
> 5

console.log(result.isSuccess);
> true

console.log(result.getResult());
> null
```

{% hint style="warning" %}

> **Always the returned result value from success method will be null.**
>
> If you need to get the returned value use **Result.ok**
> {% endhint %}
