This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var i = 1; | |
// +1 される前の値が出力されるのが i++ | |
console.log(i++) // 1 | |
// そして次に呼び出すときには +1 されている | |
console.log(i) // 2 | |
var j = 1; | |
// +1 された後の値が出力されるのが ++j | |
console.log(++j) // 2 | |
console.log(j) // 2 |