为什么要这段代码:
var score = 0;
score = ("H".charCodeAt(0) === "H".charCodeAt(0)) ? score += 1 : score;
console.log("score should be one here and it is = " + score);
虽然以下内容似乎无效:
var score = 0;
score = ("H".charCodeAt(0) === "H".charCodeAt(0)) ? score ++ : score;
console.log("score should be one here but its (zero) = " + score);
从技术上来说我也一样吗?我正在使用nodejs来运行它。