Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nmpeterson opened this issue Jan 17, 2023 · 1 comment

Comments

@nmpeterson
Copy link

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

@AlvaroCastroC
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants