Possible Duplicate:
How to: The ~ operator?
What’s the ~ operator does in javascript?
input
alert(~1)
output is
-2
input
~function () {}()
output is
-1
I never heard about ~ operator in javascript
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is the bitwise not operator that inverts the value of every bit in the integer. In binary a signed integer has the following representation:
See this wikipedia article.