Skip to content

Conversation

@RonSchoon
Copy link
Contributor

Make it even smaller...

Make it even smaller...
Comment on lines -17 to +20
var a = [];
var k = e.which;

for (i = 48; i < 58; i++)
a.push(i);
a.push(46); //period

if (!(a.indexOf(k) >= 0))
var key = String.fromCharCode(e.which);
var allowed = ",.0123456789";

if (!allowed.includes(key))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reduce function with 3 lines of code.

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

Successfully merging this pull request may close these issues.

1 participant