論理和の計算
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | <!doctype html> < html > < head > < meta charset = "utf-8" > < title >無題ドキュメント</ title > </ head > < script type = "text/javascript" > var testValue1 = 1; var testValue2 = 2; var returnValue1 = testValue1 & 1; var returnValue2 = testValue1 & 2; var returnValue3 = testValue1 & 3; document.write("testValue = " + testValue1 + " & 01 = " + returnValue1 + " " + testValue1 + " & 10 = " + returnValue2 + " " + testValue1 + " & 11 = " + returnValue3 + "< br />"); returnValue1 = testValue2 & 1; returnValue2 = testValue2 & 2; returnValue3 = testValue2 & 3; document.write("testValue = " + testValue2 + " & 01 = " + returnValue1 + " " + testValue2 + " & 10 = " + returnValue2 + " " + testValue2 + " & 11 = " + returnValue3 + "< br />"); </ script > < body > </ body > </ html > |