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

Multiplying Math.random() is causing an unexpected token error #1314

Closed
notclickable opened this issue Apr 20, 2017 · 1 comment
Closed

Multiplying Math.random() is causing an unexpected token error #1314

notclickable opened this issue Apr 20, 2017 · 1 comment

Comments

@notclickable
Copy link

In sketch.paperjs.org, across chrome,safari, on OSX & Windows:
var i = Math.random();
// works as expected
var i2 = Math.random()*2;
//SyntaxError: Unexpected token ','

@lehni
Copy link
Member

lehni commented Apr 20, 2017

Interestingly enough, if I write it with spaces around the multiply sign, it works:

var i2 = Math.random() * 2;

Looks to me like a case of wrong string indices used. Thanks for spotting! Will fix ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants