Skip to content

[JavaScript] Vector includes will return false for first element #37063

@Ashci42

Description

@Ashci42

Describe the bug, including details regarding any error messages, version, and platform.

The implementation for includes in the Vector class seems to have a minor bug: the comparison will return false if argument is the first element (element at index 0).

Example code:

import {vectorFromArray} from 'apache-arrow';
const arr = [1, 2, 3];
const v = vectorFromArray(arr);
console.log(v.includes(1)); // false 
console.log(v.indexOf(1)); // 0

Component(s)

JavaScript

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions