Although I would like to ask since the language intends for the developer to be intentional, what about cases where the developer cannot account for the data type from users' input?
say a form field designated as an array where the user is free to input either a string, number etc.
Although I would like to ask since the language intends for the developer to be intentional, what about cases where the developer cannot account for the data type from users' input?
say a form field designated as an array where the user is free to input either a string, number etc.
Inputs are strings. For you to do anything with them in other data types you have to cast them (convert).
I understand thanks
Or even better. Properly validate the input to make sure the value is in the correct type.
thanks.
I'll try it