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

Text should accept number #28

Open
lippyDesign opened this issue May 30, 2019 · 2 comments
Open

Text should accept number #28

lippyDesign opened this issue May 30, 2019 · 2 comments

Comments

@lippyDesign
Copy link

Text should be accepting numbers as well as strings. Numbers are easily rendered, why not accept them? By converting my numbers to strings I first have to check if number is defined, wasting CPU ticks

@eghan
Copy link

eghan commented May 30, 2019

you can use implicit type coercion, ( +'' )
as per:
let number_twelve = 12
let string_twelve = number_twelve + ''

console.log(typeof(number_twelve)) // number
console.log(typeof(string_twelve)) // string

@lippyDesign
Copy link
Author

Thank you for the quick response. I think allowing numbers should be okay though. Or is there any other reason why they are not allowed?

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