GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Array.prototype.includes returns false for NaN · Issue #1735 · TypeScriptToLua/TypeScriptToLua

Array.prototype.includes returns false for NaN #1735

New issue
Copy link
New issue
Copy link
Closed
#1737
Closed
Array.prototype.includes returns false for NaN#1735
#1737
Copy link

Description

@trackoor
trackoor
opened on Nov 7, 2026
Issue body actions

In typescript-to-lua 1.37.1, calling Array.prototype.includes(NaN) on an array containing NaN evaluates to false instead of true.

const arr = [1, NaN, 3];
console.log(arr.includes(NaN));

Transpiling with tstl and running in Lua prints false, whereas Node and V8 print true as required by the ECMAScript SameValueZero comparison in Array.prototype.includes.

__TS__ArrayIncludes compares elements with self[i] == searchElement, which is always false in Lua when both sides are NaN.

Credit: https://ucsbplse.github.io/

Activity

  1. Perryvw
    closed this as completedin #1737on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.