stdlib-js / stdlib

✨ Standard library for JavaScript and Node.js. ✨
https://stdlib.io
Apache License 2.0
4.34k stars 440 forks source link

[RFC]: add `@stdlib/array/base/cunone` #2321

Closed kgryte closed 2 months ago

kgryte commented 3 months ago

Description

This RFC proposes adding the package @stdlib/array/base/cunone, which cumulatively tests whether every array element in a provided array is falsy. The function should return a new generic array. The package should also provide an #assign API for setting output values in a provided output array.

var x = [ false, false, false, true, false ];

var y1 = cunone( x );
// returns [ true, true, true, false, false ]

var y2 = [ false, null, false, null, false, null, false, null, false, null ];
var out = cunone.assign( x, y2, 2, 0 );
// returns [ true, null, true, null, true, null, false, null, false, null ]

where the assign API supports an offset and stride (see, e.g., @stdlib/array/base/take).

Both APIs should support accessor arrays (see, e.g., @stdlib/array/base/take).

Related Issues

No.

Questions

No.

Other

No.

Checklist

adityacodes30 commented 3 months ago

I'd like to work on this !

kgryte commented 3 months ago

@adityacodes30 Assigned.