Skip to content

Async Typer UI - getRandomBetween() not behaving as expected because it's being called with strings #230

Closed

Description

@nmpeterson

const amountOfTimeToWait = getRandomBetween(typeMin, typeMax);

When passed to getRandomBetween() here, typeMin and typeMax are still strings taken directly from el.dataset. Not sure exactly how the function is treating these numeric strings under the hood, but it's not parsing them as ints:

image

Activity

  1. AlvaroCastroC commented on Nov 28, 2023

    @AlvaroCastroC

    Olá, é provável que na linha 27, onde:

    const { typeMin, typeMax } = el.dataset;

    O el.dataset, esteja passando os valores em string. tente adicionar nessa linha de código o parseInt:

    const { typeMin, typeMax } = parseInt(el.dataset);

    Talvez consiga converter esses valores em numbers.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions