(function () { var names = []; return function (name) {addname (name); function AddName (name) {
if (!~names.indexof (name))
//
If present, do not add
Names.push (name); Console.log (names);
//
["Linkfly"]
' linkfly ');
Original code
The highest bit of the original code notation is the sign bit, which is 0 for positive numbers and 1 for negative numbers. The remaining bits represent the absolute value of the number.
Anti-code
For a signed number, the inverse code of positive numbers is the same as its original code, and the inverse of negative numbers is reversed for each of its original code except the sign bit. The inverse code is often used to do the intermediate form in the process of seeking the complement.
Complement
The complement of a positive number is the same as the original code and the inverse code, and the complement of the negative is the opposite of the symbol bit of the original code, and is obtained by adding 1 at the bottom, that is, the complement of the numbers plus 1. The number in the computer is usually in the form of a complement. In the complement ( -128) d instead of ( -0) d, note: ( -128) d does not correspond to the original code and the inverse code, ( -128) d = (1000,0000) B.
Calculation of the complement
The complement operation does not consider the symbol bit, the original code of the people take the reverse, and in the bottom plus 1 to get. The complement of a number is the inverse number of the number.
If the operator in the!~names.indexof (name) "!~" what meaning, do not understand, start from ~.
The test can draw the result value has this Law-(x+1)
IndexOf for 0 is to take the anti-nonexistent!0 to true Add. Indexof==-1//to do's xx notation
What does!~ mean in JS?