function addWithoutPlusOperator (a, b){ // 111, 111
var sumWithoutCarry = a ^ b; // 000
var carryWithoutSum = (a & b) << 1; //111 << 1 = 1110
return addWithoutPlusOperator( sumWithoutCarry, carryWithoutSum );
}
var sumWithoutCarry = a ^ b; // 000
var carryWithoutSum = (a & b) << 1; //111 << 1 = 1110
return addWithoutPlusOperator( sumWithoutCarry, carryWithoutSum );
}
No comments:
Post a Comment