Skip to content
Advertisement

int unexpectedly turning into string

With the following snippet from a script:

JavaScript

I expected the outcome to be:

JavaScript

but instead I get:

JavaScript

Does anyone know why this is happening and how I can fix it? In case you need it here is SelectTile:

JavaScript

Advertisement

Answer

You are not assigning the new int value to the original variable. Here’s a fix:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement