JSLint reports unexpected use of '&' and '|' -- I'd like to clean this

Posted by Zhami on Stack Overflow See other posts from Stack Overflow or by Zhami
Published on 2010-06-14T18:18:55Z Indexed on 2010/06/14 18:22 UTC
Read the original article Hit count: 218

Filed under:
|

I'm trying to get my Javascript code 100% JSLint clean.

I've got some JS code that I've lifted from elsewhere to create a UUID. That code has the following line:

s[16] = hexDigits.substr((s[16] & 0x3) | 0x8, 1);

This line incites JSLint to generate two error messages:

1) Unexpected use of '&'
2) Unexpected use of '|'

I don't understand why -- I'd appreciate counsel regarding how to recode to eliminate the error message.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jslint