Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Convert from int to byte in JavaScript

843838Feb 13 2006 — edited Feb 13 2006
I have a small piece of code in Java,

int x = 216;
System.out.println((byte)x);

I'd like to convert this to JavaScript form and that means, I want to be able to get the exact answer from this code which is -40. How do I do that?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 13 2006
Added on Feb 13 2006
4 comments
3,007 views