stdlib icon indicating copy to clipboard operation
stdlib copied to clipboard

[RFC]: add `@stdlib/array/base/count-if`

Open kgryte opened this issue 2 years ago • 3 comments

Description

This RFC proposes adding the package @stdlib/array/base/count-if.

The package should be structured similarly to @stdlib/array/base/count-truthy.

The package should expose an API having the same signature as countTruthy, with the addition of predicate and thisArg arguments.

function countIf( x, predicate[, thisArg] ) {...}

The predicate function should return a boolean value. If true, the function should increment a count; otherwise, the value is ignored.

Package: @stdlib/array/base/count-if Alias: countIf

Related Issues

None.

Questions

No.

Other

This package should expose an API similar to the Excel/GSheets function of the same name: https://support.google.com/docs/answer/3093480?sjid=2342692862647625777-NC.

Checklist

  • [X] I have read and understood the Code of Conduct.
  • [X] Searched for existing issues and pull requests.
  • [X] The issue name begins with RFC:.

kgryte avatar Feb 21 '24 03:02 kgryte

@Alzamer Thanks for volunteering to work on this issue. Please feel free to submit a PR implementing the requested feature.

kgryte avatar Feb 22 '24 08:02 kgryte

Hi, I would like to work on this, can you assign this issue to me?

bad-in-coding avatar Feb 23 '24 09:02 bad-in-coding

Thanks for volunteering to work on this @Ut-the-pro. Please feel free to submit a PR implementing this feature.

kgryte avatar Feb 23 '24 09:02 kgryte